Files
sam-react-prod/src/components/organisms/StatCards.tsx
byeongcheolryu 3be5714805 refactor: 품목관리 시스템 리팩토링 및 Sales 페이지 추가
DynamicItemForm 개선:
- 품목코드 자동생성 기능 추가
- 조건부 표시 로직 개선
- 불필요한 컴포넌트 정리 (DynamicField, DynamicSection 등)
- 타입 시스템 단순화

새로운 기능:
- Sales 페이지 마이그레이션 (견적관리, 거래처관리)
- 공통 컴포넌트 추가 (atoms, molecules, organisms, templates)

문서화:
- 구현 문서 및 참조 문서 추가

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-04 12:48:41 +09:00

55 lines
1.6 KiB
TypeScript

"use client";
import { Card, CardContent } from "@/components/ui/card";
import { LucideIcon } from "lucide-react";
interface StatCardData {
label: string;
value: string | number;
icon?: LucideIcon;
iconColor?: string;
trend?: {
value: string;
isPositive: boolean;
};
}
interface StatCardsProps {
stats: StatCardData[];
}
export function StatCards({ stats }: StatCardsProps) {
return (
<div className="grid grid-cols-2 lg:grid-cols-4 gap-3 md:gap-4">
{stats.map((stat, index) => {
const Icon = stat.icon;
return (
<Card key={index}>
<CardContent className="p-3 md:p-4 lg:p-6">
<div className="flex items-center justify-between">
<div className="flex-1">
<p className="sm:text-xs md:text-sm text-muted-foreground mb-1 md:mb-2 uppercase tracking-wide text-[12px]">
{stat.label}
</p>
<p className="font-bold text-[24px]">
{stat.value}
</p>
{stat.trend && (
<p className={`text-[10px] sm:text-xs md:text-sm mt-1 md:mt-2 font-medium ${stat.trend.isPositive ? 'text-green-600' : 'text-red-600'}`}>
{stat.trend.value}
</p>
)}
</div>
{Icon && (
<Icon
className={`w-8 h-8 sm:w-9 sm:h-9 md:w-10 md:h-10 lg:w-12 lg:h-12 opacity-15 ${stat.iconColor || 'text-blue-600'}`}
/>
)}
</div>
</CardContent>
</Card>
);
})}
</div>
);
}