46 lines
891 B
TypeScript
46 lines
891 B
TypeScript
import type { Meta, StoryObj } from '@storybook/react';
|
|
import { AvatarUpload, AvatarUploadSkeleton } from './avatar-upload';
|
|
|
|
const meta = {
|
|
title: 'UI/AvatarUpload',
|
|
component: AvatarUpload,
|
|
tags: ['autodocs'],
|
|
argTypes: {
|
|
size: {
|
|
control: 'select',
|
|
options: ['sm', 'md', 'lg', 'xl'],
|
|
},
|
|
disabled: { control: 'boolean' },
|
|
},
|
|
args: {
|
|
userId: '123',
|
|
},
|
|
} satisfies Meta<typeof AvatarUpload>;
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
export const Default: Story = {};
|
|
|
|
export const WithExistingAvatar: Story = {
|
|
args: {
|
|
currentAvatarUrl: 'https://github.com/shadcn.png',
|
|
},
|
|
};
|
|
|
|
export const Disabled: Story = {
|
|
args: {
|
|
disabled: true,
|
|
},
|
|
};
|
|
|
|
export const Large: Story = {
|
|
args: {
|
|
size: 'xl',
|
|
},
|
|
};
|
|
|
|
export const Loading: Story = {
|
|
render: () => <AvatarUploadSkeleton size="lg" />,
|
|
name: 'Chargement',
|
|
};
|