gitscope
← marzneshin / v0.5.5 / dashboard/src/features/entity-table/components/sidebar-entity-card.tsx
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/features/entity-table/components/sidebar-entity-card.tsx · TypeScript
Blame Raw
 1import {
 2    Card,
 3    CardContent,
 4} from "@marzneshin/components";
 5import {
 6    cn
 7} from "@marzneshin/utils";
 8import { type FC } from 'react'
 9
10interface SidebarEntityCardSectionProps<T> {
11    entity: T;
12}
13
14export interface SidebarEntityCardSectionsProps<T> {
15    header: FC<SidebarEntityCardSectionProps<T>>;
16    content: FC<SidebarEntityCardSectionProps<T>>;
17}
18
19export const SidebarEntityCard: FC<SidebarEntityCardSectionProps<any> & SidebarEntityCardSectionsProps<any> & { checked: boolean }> = ({
20    header: Header, content: Content, entity, checked = false
21}) => {
22    return (
23        <Card className="w-full h-30 m-[4px]">
24            <CardContent className={cn("p-2 flex-col flex gap-2 justify-start", checked && "dark:bg-primary-foreground bg-secondary")}>
25                <Header entity={entity} />
26                <Content entity={entity} />
27            </CardContent>
28        </Card>
29    )
30}