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