Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | 10x 10x 10x 24x 29x 29x 29x 3x 94x | import { TabList } from "@mui/lab";
import { Tab } from "@mui/material";
import makeStyles from "utils/makeStyles";
export const useStyles = makeStyles((theme) => ({
messagesTab: {
[theme.breakpoints.down("md")]: {
overflow: "visible",
margin: `0 ${theme.spacing(2)}`,
},
},
}));
export interface TabBarProps<T extends Record<string, React.ReactNode>> {
ariaLabel: string;
labels: T;
setValue: (value: keyof T) => void;
}
export default function TabBar<T extends Record<string, React.ReactNode>>({
ariaLabel,
setValue,
labels,
}: TabBarProps<T>) {
const classes = useStyles();
const handleChange = (event: React.SyntheticEvent, newValue: keyof T) => {
setValue(newValue);
};
return (
<TabList
aria-label={ariaLabel}
onChange={handleChange}
indicatorColor="primary"
textColor="primary"
scrollButtons="auto"
allowScrollButtonsMobile
variant="scrollable"
>
{Object.entries(labels).map(([value, label]) => (
<Tab
key={value}
label={label}
value={value}
className={classes.messagesTab}
/>
))}
</TabList>
);
}
|