veza/apps/web/src/components/education/CourseCard.stories.tsx

61 lines
1.3 KiB
TypeScript

import type { Meta, StoryObj } from '@storybook/react';
import { CourseCard } from './CourseCard';
import { Course } from '../../types';
const mockCourse: Course = {
id: 'c1',
title: 'Advanced Sound Design',
instructor: 'Alex Sound',
thumbnailUrl: 'https://picsum.photos/id/100/400/250',
level: 'Advanced',
duration: '4h 30m',
rating: 4.8,
studentCount: 1200,
price: 49.99,
progress: 0,
};
const meta = {
title: 'Components/Features/Education/CourseCard',
component: CourseCard,
tags: ['autodocs'],
argTypes: {
onClick: { action: 'clicked' },
},
decorators: [
(Story) => (
<div className="w-[300px]">
<Story />
</div>
),
],
} satisfies Meta<typeof CourseCard>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
course: mockCourse,
},
};
export const InProgress: Story = {
args: {
course: { ...mockCourse, progress: 60 },
showProgress: true,
},
};
export const Completed: Story = {
args: {
course: { ...mockCourse, progress: 100, certificateAvailable: true },
showProgress: true,
},
};
export const Beginner: Story = {
args: {
course: { ...mockCourse, level: 'Beginner', title: 'Intro into Music' },
},
};