import type { Meta, StoryObj } from '@storybook/react'; import { Avatar, AvatarImage, AvatarFallback } from './avatar'; import { User } from 'lucide-react'; import React from 'react'; type AvatarStoryProps = React.ComponentProps & { src?: string; fallback?: string; }; const meta: Meta = { title: 'UI/Avatar', component: Avatar, render: args => , argTypes: { size: { control: 'select', options: ['xs', 'sm', 'md', 'lg', 'xl'], description: 'Size of the avatar.', defaultValue: 'md', }, src: { control: 'text', description: 'The source URL of the avatar image.', defaultValue: 'https://github.com/shadcn.png', }, fallback: { control: 'text', description: 'The fallback text to display if the image fails to load.', defaultValue: 'CN', }, }, }; export default meta; type Story = StoryObj; export const Default: Story = { args: { size: 'md', src: 'https://github.com/shadcn.png', fallback: 'CN', }, render: ({ src, fallback, ...args }) => ( {fallback} ), }; export const Small: Story = { render: () => ( CN ), }; export const Large: Story = { render: () => ( CN ), }; export const FallbackInitials: Story = { render: () => ( JD ), }; export const FallbackIcon: Story = { render: () => ( ), };