48 lines
1.4 KiB
TypeScript
48 lines
1.4 KiB
TypeScript
import type { Meta, StoryObj } from '@storybook/react-vite';
|
||
import { EventCardSkeleton } from '@/components/events/event-card.skeleton';
|
||
import { EventCardView } from '@/components/events/event-card.view';
|
||
import { Button } from '@/components/ui/button';
|
||
|
||
const meta = {
|
||
title: 'Events/EventCard',
|
||
component: EventCardView,
|
||
} satisfies Meta<typeof EventCardView>;
|
||
|
||
export default meta;
|
||
type Story = StoryObj<typeof meta>;
|
||
|
||
export const Primary: Story = {
|
||
args: {
|
||
eventInfo: {
|
||
eventId: '1',
|
||
type: 'official',
|
||
requireKyc: true,
|
||
isJoined: false,
|
||
coverImage: 'https://github.com/NixOS/nixos-artwork/blob/master/wallpapers/nix-wallpaper-watersplash.png?raw=true',
|
||
eventName: 'Nix CN Conference 26.05',
|
||
description: 'Event Description',
|
||
startTime: new Date('2026-06-13T04:00:00.000Z'),
|
||
endTime: new Date('2026-06-14T04:00:00.000Z'),
|
||
},
|
||
actionFooter: <Button className="w-full">加入活动(示例)</Button>,
|
||
},
|
||
};
|
||
|
||
export const Loading: Story = {
|
||
render: () => <EventCardSkeleton />,
|
||
args: {
|
||
eventInfo: {
|
||
eventId: '1',
|
||
type: 'official',
|
||
requireKyc: true,
|
||
coverImage: '',
|
||
isJoined: false,
|
||
eventName: '',
|
||
description: '',
|
||
startTime: new Date(0),
|
||
endTime: new Date(0),
|
||
},
|
||
actionFooter: <Button className="w-full">加入活动(示例)</Button>,
|
||
},
|
||
};
|