I have vertical tabs as below, need to apply custom CSS class [completed] on tab which is completed [filled]
return (
<CustomVerticalTabs theme={theme} className="u-vertical-tabs">
<Tabs className="tab-list-vertical"
orientation="vertical"
variant="scrollable"
value={value}
onChange={handleChange}
aria-label="Vertical tabs example"
sx={{
[`& .${tabsClasses.scrollButtons}`]: {
'&.Mui-disabled': { opacity: 0.3 },
},
}}
>
{items.map((item, index) => (
<Tab className={`u-tab-btn ${index === value ? 'completed' :''}`} label={item.title} key={index} />
))}
</Tabs>
{items.map((item, index) => (
<TabPanel theme={theme} value={value} index={index} key={index}>
{item.content}
</TabPanel>
))}
</CustomVerticalTabs>
)
}
const handleChange = (event: React.SyntheticEvent, newValue: number) => {
setValue(newValue)
}
by applying ${index === value ? completed :or even ${index === value-1 ? completed :it applies to all rest of tabs [except clicked]. I need style to be applied only the previously active tab, but neither the currently active, nor the others (never activated, or before the previous one)