2020-11-29 01:25:48 -07:00
|
|
|
import { Box } from '@chakra-ui/react';
|
2020-10-19 08:17:10 -07:00
|
|
|
import { useColorValue } from '~/context';
|
2020-11-29 01:25:48 -07:00
|
|
|
|
|
|
|
import type { BoxProps } from '@chakra-ui/react';
|
2020-10-19 08:17:10 -07:00
|
|
|
|
|
|
|
export const Table = (props: BoxProps) => (
|
|
|
|
<Box as="table" textAlign="left" mt={4} width="full" {...props} />
|
|
|
|
);
|
|
|
|
|
2020-11-29 01:25:48 -07:00
|
|
|
export const TH = (props: BoxProps) => {
|
2020-10-19 08:17:10 -07:00
|
|
|
const bg = useColorValue('blackAlpha.50', 'whiteAlpha.50');
|
|
|
|
return <Box as="th" bg={bg} fontWeight="semibold" p={2} fontSize="sm" {...props} />;
|
|
|
|
};
|
|
|
|
|
2020-11-29 01:25:48 -07:00
|
|
|
export const TD = (props: BoxProps) => {
|
2020-10-19 08:17:10 -07:00
|
|
|
return (
|
|
|
|
<Box
|
|
|
|
p={2}
|
2020-11-29 01:25:48 -07:00
|
|
|
as="td"
|
2020-10-19 08:17:10 -07:00
|
|
|
fontSize="sm"
|
|
|
|
whiteSpace="normal"
|
2020-11-29 01:25:48 -07:00
|
|
|
borderTopWidth="1px"
|
|
|
|
borderColor="inherit"
|
|
|
|
{...props}
|
2020-10-19 08:17:10 -07:00
|
|
|
/>
|
|
|
|
);
|
|
|
|
};
|