This commit is contained in:
Tomáš Dvořák
2025-10-16 13:32:05 +02:00
commit 12cba639b9
663 changed files with 168914 additions and 0 deletions
@@ -0,0 +1,30 @@
import { Box, BoxProps, Heading, Icon, useColorModeValue } from '@chakra-ui/react';
import { ReactNode } from 'react';
interface WidgetProps extends BoxProps {
title: string;
icon?: any;
children: ReactNode;
}
export const Widget = ({ title, icon, children, ...rest }: WidgetProps) => {
return (
<Box
bg={useColorModeValue('white', 'gray.800')}
p={4}
borderRadius="lg"
boxShadow="sm"
borderWidth="1px"
borderColor={useColorModeValue('gray.200', 'gray.700')}
_hover={{ boxShadow: 'md' }}
transition="all 0.2s"
{...rest}
>
<Heading size="md" mb={4} display="flex" alignItems="center">
{icon && <Icon as={icon} mr={2} />}
{title}
</Heading>
{children}
</Box>
);
};