lookingglass/hyperglass/ui/elements/card/body.tsx
2021-12-19 22:57:00 -07:00

27 lines
649 B
TypeScript

import { Flex } from '@chakra-ui/react';
import { useColorValue } from '~/context';
import type { FlexProps } from '@chakra-ui/react';
interface CardBodyProps extends Omit<FlexProps, 'onClick'> {
onClick?: () => boolean;
}
export const CardBody = (props: CardBodyProps): JSX.Element => {
const { onClick, ...rest } = props;
const bg = useColorValue('white', 'dark.500');
const color = useColorValue('dark.500', 'white');
return (
<Flex
bg={bg}
w="100%"
rounded="md"
color={color}
onClick={onClick}
overflow="hidden"
borderWidth="1px"
direction="column"
{...rest}
/>
);
};