gitscope
← marzneshin / v0.7.4 / dashboard/src/common/components/widgets/mini-widget/index.tsx
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/common/components/widgets/mini-widget/index.tsx · TypeScript
Blame Raw
 1import {
 2    Card,
 3    CardContent,
 4    CardFooter,
 5    CardHeader,
 6    CardTitle,
 7} from '@marzneshin/common/components';
 8import type { FC, PropsWithChildren } from 'react';
 9
10export interface MiniWidgetProps extends PropsWithChildren {
11    title: JSX.Element | string;
12    content?: JSX.Element | string;
13    footer?: JSX.Element | string;
14}
15
16export const MiniWidget: FC<MiniWidgetProps> = ({ footer, content, children, title }) => {
17    return (
18        <Card>
19            <CardHeader className="p-4">
20                <CardTitle className="flex flex-row justify-start items-center gap-3 text-lg">
21                    {title}
22                </CardTitle>
23            </CardHeader>
24            <CardContent className="p-4">
25                {content || children}
26            </CardContent>
27            {footer && <CardFooter> {footer} </CardFooter>}
28        </Card>
29    )
30}