Files
nym/explorer/src/components/CustomColumnHeading.tsx
T
2021-11-23 15:20:23 +00:00

31 lines
793 B
TypeScript

import * as React from 'react';
import { Box, Typography } from '@mui/material';
import { ExpandLess, ExpandMore } from '@mui/icons-material';
export const CustomColumnHeading: React.FC<{ headingTitle: string }> = ({
headingTitle,
}) => {
const [filter, toggleFilter] = React.useState<boolean>(false);
const handleClick = () => {
toggleFilter(!filter);
};
return (
<Box alignItems="center" display="flex" onClick={handleClick}>
<Typography
sx={{
fontWeight: 'bold',
fontSize: 14,
padding: 0,
// border: '1px solid red',
// minWidth: 300,
}}
data-testid={headingTitle}
>
{headingTitle}&nbsp;
</Typography>
{filter ? <ExpandMore /> : <ExpandLess />}
</Box>
);
};