gitscope
← marzneshin / v0.5.6 / dashboard/src/components/alert-card/index.tsx
https://dev.kronoz.win/r/marzneshin.git
dashboard/src/components/alert-card/index.tsx · TypeScript
Blame Raw
 1import { Info, TriangleAlert, OctagonAlert } from 'lucide-react';
 2import {
 3    Alert,
 4    AlertDescription,
 5    AlertTitle,
 6} from '@marzneshin/components';
 7
 8export const AlertCard = ({ title, desc, variant = "default" }: { variant?: "warning" | "default" | "destructive", title: string | JSX.Element, desc: string | JSX.Element }) => {
 9    const Icon = variant === "warning" ? TriangleAlert : (variant === "destructive" ? OctagonAlert : Info)
10    return (
11        <Alert variant={variant}>
12            <Icon className="mr-2" />
13            <AlertTitle className="font-semibold">{title}</AlertTitle>
14            <AlertDescription>
15                {desc}
16            </AlertDescription>
17        </Alert>
18    )
19}
20