Initial import of 1407 block sources under blocks/
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -0,0 +1,60 @@
|
||||
import { DollarSign, ShoppingCart, TrendingUp, Users } from "lucide-react";
|
||||
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { cn } from "@/lib/utils";
|
||||
|
||||
const formatPrice = (value: number) =>
|
||||
`${value.toLocaleString("fa-IR")} ریال`;
|
||||
|
||||
const formatChange = (value: number) =>
|
||||
`${new Intl.NumberFormat("fa-IR", {
|
||||
minimumFractionDigits: 1,
|
||||
maximumFractionDigits: 1,
|
||||
signDisplay: "exceptZero",
|
||||
}).format(value)}٪`;
|
||||
|
||||
type IconType = "dollar" | "users" | "cart" | "trending";
|
||||
|
||||
interface StatsCard5Props {
|
||||
title?: string;
|
||||
value?: string;
|
||||
subtitle?: string;
|
||||
icon?: IconType;
|
||||
className?: string;
|
||||
}
|
||||
|
||||
const iconMap = {
|
||||
dollar: DollarSign,
|
||||
users: Users,
|
||||
cart: ShoppingCart,
|
||||
trending: TrendingUp,
|
||||
};
|
||||
|
||||
const StatsCard5 = ({
|
||||
title = "مجموع درآمد",
|
||||
value = formatPrice(45231000),
|
||||
subtitle = `${formatChange(20.1)} نسبت به ماه گذشته`,
|
||||
icon = "dollar",
|
||||
className,
|
||||
}: StatsCard5Props) => {
|
||||
const Icon = iconMap[icon];
|
||||
|
||||
return (
|
||||
<Card dir="rtl" lang="fa" className={cn("w-full max-w-xs", className)}>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
<CardTitle className="text-sm font-medium text-muted-foreground">
|
||||
{title}
|
||||
</CardTitle>
|
||||
<div className="rounded-md bg-primary/10 p-2">
|
||||
<Icon className="size-4 text-primary" />
|
||||
</div>
|
||||
</CardHeader>
|
||||
<CardContent>
|
||||
<div className="text-3xl font-bold">{value}</div>
|
||||
<p className="mt-1 text-sm text-muted-foreground">{subtitle}</p>
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
};
|
||||
|
||||
export { StatsCard5 };
|
||||
Reference in New Issue
Block a user