Major categories fixed: - TS6133 (188): Remove unused imports (React, icons, types) and variables - TS2322 (222): Fix type mismatches in stories (satisfies Meta -> const meta: Meta), add nullish coalescing for optional values, fix component prop types - TS2345 (43): Fix argument type mismatches with proper null checks and type narrowing - TS2741 (21): Add missing required properties to mock/story data - TS2339 (19): Fix property access on incorrect types, add type guards - TS2353 (13): Remove extra properties from object literals or extend interfaces - TS2352 (11): Fix type conversion chains - TS2307 (9): Fix import paths and module references - Other (42): Fix implicit any, possibly undefined, export declarations Vite build and tsc --noEmit both pass cleanly. Co-authored-by: Cursor <cursoragent@cursor.com>
51 lines
1.3 KiB
TypeScript
51 lines
1.3 KiB
TypeScript
import type { Meta, StoryObj } from '@storybook/react';
|
|
import { StatCard } from './StatCard';
|
|
import { Music, Users, DollarSign } from 'lucide-react';
|
|
|
|
const meta = {
|
|
title: 'Components/Features/Dashboard/StatCard',
|
|
component: StatCard,
|
|
tags: ['autodocs'],
|
|
decorators: [
|
|
(Story) => (
|
|
<div className="w-80 min-h-50 p-4 bg-background">
|
|
<Story />
|
|
</div>
|
|
),
|
|
],
|
|
} satisfies Meta<typeof StatCard>;
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
export const Default: Story = {
|
|
args: {
|
|
label: 'Total Plays',
|
|
value: '1.2M',
|
|
icon: <Music className="w-5 h-5 text-foreground" />,
|
|
trend: '+12.5',
|
|
color: 'cyan',
|
|
sparklineData: [40, 30, 45, 50, 60, 75, 80],
|
|
},
|
|
};
|
|
|
|
export const NegativeTrend: Story = {
|
|
args: {
|
|
label: 'Revenue',
|
|
value: '$432.50',
|
|
icon: <DollarSign className="w-5 h-5 text-foreground" />,
|
|
trend: '-5.2',
|
|
color: 'red',
|
|
sparklineData: [80, 75, 70, 65, 60, 55, 50],
|
|
},
|
|
};
|
|
|
|
export const NoTrend: Story = {
|
|
args: {
|
|
label: 'Followers',
|
|
value: '5,432',
|
|
icon: <Users className="w-5 h-5 text-foreground" />,
|
|
color: 'magenta',
|
|
sparklineData: [10, 20, 15, 25, 30, 40, 50],
|
|
},
|
|
};
|