Files
nym/explorer/src/components/CustomColumnHeading.tsx
T
Tommy Verrall 1f1d91bd1e Adding data-test-ids for the explorer (#885)
* Adding all the data-test-ids

Test ID's for doing automation on explorer

* Applied lint-fix

Linting

* More data ids
2021-11-11 15:31:30 +00:00

29 lines
727 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,
}}
data-testid={headingTitle}
>
{headingTitle}&nbsp;
</Typography>
{filter ? <ExpandMore /> : <ExpandLess />}
</Box>
);
};