revert fb8e77bb68
Local Build and Deploy / deploy (push) Successful in 1m11s
Local Build and Deploy / deploy (push) Successful in 1m11s
revert style: clean up code with prettier and eslint
This commit is contained in:
1 parent
27de078f54
commit
e85e4d74ea
378 files changed
+20710
-22428
No files matched your search
@@ -1,15 +1,15 @@
|
||||
import { Minus, TrendingDown, TrendingUp } from "lucide-react";
|
||||
import Link from "next/link";
|
||||
import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card";
|
||||
import { Minus, TrendingDown, TrendingUp } from 'lucide-react'
|
||||
import Link from 'next/link'
|
||||
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card'
|
||||
|
||||
interface StatsCardProps {
|
||||
title: string;
|
||||
value: string | number;
|
||||
description?: string;
|
||||
icon?: React.ReactNode;
|
||||
href?: string;
|
||||
title: string
|
||||
value: string | number
|
||||
description?: string
|
||||
icon?: React.ReactNode
|
||||
href?: string
|
||||
/** Percentage change vs previous period. Positive = up, negative = down, undefined = no trend */
|
||||
trend?: number;
|
||||
trend?: number
|
||||
}
|
||||
|
||||
export function StatsCard({ title, value, description, icon, href, trend }: StatsCardProps) {
|
||||
@@ -17,8 +17,8 @@ export function StatsCard({ title, value, description, icon, href, trend }: Stat
|
||||
<Card
|
||||
className={
|
||||
href
|
||||
? "transition-all duration-200 hover:border-primary/50 hover:shadow-lg hover:shadow-primary/5 hover:-translate-y-0.5 cursor-pointer"
|
||||
: ""
|
||||
? 'transition-all duration-200 hover:border-primary/50 hover:shadow-lg hover:shadow-primary/5 hover:-translate-y-0.5 cursor-pointer'
|
||||
: ''
|
||||
}
|
||||
>
|
||||
<CardHeader className="flex flex-row items-center justify-between space-y-0 pb-2">
|
||||
@@ -33,13 +33,13 @@ export function StatsCard({ title, value, description, icon, href, trend }: Stat
|
||||
{description && <p className="text-xs text-muted-foreground">{description}</p>}
|
||||
</CardContent>
|
||||
</Card>
|
||||
);
|
||||
)
|
||||
|
||||
if (href) {
|
||||
return <Link href={href}>{content}</Link>;
|
||||
return <Link href={href}>{content}</Link>
|
||||
}
|
||||
|
||||
return content;
|
||||
return content
|
||||
}
|
||||
|
||||
function TrendBadge({ value }: { value: number }) {
|
||||
@@ -49,19 +49,19 @@ function TrendBadge({ value }: { value: number }) {
|
||||
<Minus className="h-3 w-3" />
|
||||
0%
|
||||
</span>
|
||||
);
|
||||
)
|
||||
}
|
||||
|
||||
const isUp = value > 0;
|
||||
const isUp = value > 0
|
||||
return (
|
||||
<span
|
||||
className={`inline-flex items-center gap-0.5 text-xs font-medium ${
|
||||
isUp ? "text-[var(--admin-success)]" : "text-[var(--admin-error)]"
|
||||
isUp ? 'text-[var(--admin-success)]' : 'text-[var(--admin-error)]'
|
||||
}`}
|
||||
>
|
||||
{isUp ? <TrendingUp className="h-3 w-3" /> : <TrendingDown className="h-3 w-3" />}
|
||||
{isUp ? "+" : ""}
|
||||
{isUp ? '+' : ''}
|
||||
{value}%
|
||||
</span>
|
||||
);
|
||||
)
|
||||
}
|
||||
Reference in new issue
Block a user