gitscope
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/common/components/widgets/section-widget/index.tsx · v0.6.3
Source
1 0178858 Dawsh 2y ago import {
2 0178858 Dawsh 2y ago Card,
3 0178858 Dawsh 2y ago CardContent,
4 e6e6467 Dawsh 2y ago CardDescription,
5 0178858 Dawsh 2y ago CardFooter,
6 0178858 Dawsh 2y ago CardHeader,
7 0178858 Dawsh 2y ago CardTitle,
8 0178858 Dawsh 2y ago Separator,
9 7389ad0 Mardin 2y ago } from '@marzneshin/common/components';
10 0178858 Dawsh 2y ago import type { FC, PropsWithChildren } from 'react';
11 0178858 Dawsh 2y ago
12 6a4fee1 Dawsh 2y ago export interface SectionWidgetProps {
13 6a4fee1 Dawsh 2y ago title: any;
14 6a4fee1 Dawsh 2y ago description: any;
15 6a4fee1 Dawsh 2y ago content?: any;
16 6a4fee1 Dawsh 2y ago footer?: any;
17 6a4fee1 Dawsh 2y ago options?: any;
18 6a4fee1 Dawsh 2y ago className?: string;
19 0178858 Dawsh 2y ago }
20 0178858 Dawsh 2y ago
21 6a4fee1 Dawsh 2y ago export const SectionWidget: FC<SectionWidgetProps & PropsWithChildren> = ({
22 6a4fee1 Dawsh 2y ago options, footer, content, children, title, description, className
23 e6e6467 Dawsh 2y ago }) => {
24 0178858 Dawsh 2y ago return (
25 6a4fee1 Dawsh 2y ago <Card className={className}>
26 e6e6467 Dawsh 2y ago <CardHeader className="flex flex-col items-stretch space-y-0 border-b p-0 sm:flex-row">
27 e6e6467 Dawsh 2y ago <div className="flex flex-1 flex-col justify-center gap-1 px-6 py-5 sm:py-6">
28 e6e6467 Dawsh 2y ago <CardTitle className="flex flex-row justify-start items-center gap-3 text-xl">
29 e6e6467 Dawsh 2y ago {title}
30 e6e6467 Dawsh 2y ago </CardTitle>
31 e6e6467 Dawsh 2y ago <CardDescription>
32 e6e6467 Dawsh 2y ago {description}
33 e6e6467 Dawsh 2y ago </CardDescription>
34 e6e6467 Dawsh 2y ago </div>
35 e6e6467 Dawsh 2y ago {options &&
36 e6e6467 Dawsh 2y ago <div className="flex items-center flex-col justify-center gap-1 px-6 py-5 sm:py-6">
37 e6e6467 Dawsh 2y ago {options}
38 e6e6467 Dawsh 2y ago </div>
39 e6e6467 Dawsh 2y ago }
40 0178858 Dawsh 2y ago </CardHeader>
41 0178858 Dawsh 2y ago <Separator />
42 b15de9e Erfan 2y ago <CardContent className="p-4 flex justify-center">
43 0178858 Dawsh 2y ago {content || children}
44 0178858 Dawsh 2y ago </CardContent>
45 b15de9e Erfan 2y ago {footer && <CardFooter className="flex w-full justify-center"> {footer} </CardFooter>}
46 0178858 Dawsh 2y ago </Card>
47 0178858 Dawsh 2y ago )
48 0178858 Dawsh 2y ago }