el.xwx.moe/components/DashboardItem.tsx
2024-08-18 02:55:59 -04:00

27 lines
818 B
TypeScript

export default function dashboardItem({
name,
value,
icon,
}: {
name: string;
value: number;
icon: string;
}) {
return (
<div className="flex items-center">
<div className="w-[4rem] aspect-square flex justify-center items-center bg-primary/20 rounded-xl select-none">
<i className={`${icon} text-primary text-3xl drop-shadow`}></i>
</div>
<div className="ml-4 flex flex-col justify-center">
<p className="text-neutral text-xs tracking-wider">{name}</p>
<p className="font-thin text-5xl text-primary mt-0.5 hidden sm:block md:hidden">
{value < 1000 ? value : (value / 1000).toFixed(1) + "k"}
</p>
<p className="font-thin text-5xl text-primary mt-0.5 sm:hidden md:block">
{value}
</p>
</div>
</div>
);
}