import type { Meta, StoryObj } from "@storybook/react-vite"; import { Avatar } from "./avatar"; const meta = { title: "Components/Avatar", component: Avatar, parameters: { layout: "centered", }, tags: ["autodocs"], args: { name: "John Doe", src: "https://i.pravatar.cc/150?img=1", }, } satisfies Meta; export default meta; type Story = StoryObj; export const Default: Story = {}; export const WithName: Story = { args: { name: "Jane Smith", src: "https://i.pravatar.cc/150?img=5", }, }; export const Fallback: Story = { args: { name: "Alice Johnson", src: "invalid-url", }, }; export const FallbackWithCustomColor: Story = { args: { name: "Bob Wilson", src: "invalid-url", fallbackBackgroundColor: "#3b82f6", fallbackTextColor: "#ffffff", }, }; export const FallbackWithCustomText: Story = { args: { fallbackText: "AB", src: "invalid-url", fallbackBackgroundColor: "#10b981", fallbackTextColor: "#ffffff", }, }; export const Small: Story = { args: { name: "Small Avatar", src: "https://i.pravatar.cc/150?img=2", size: "sm", }, }; export const Medium: Story = { args: { name: "Medium Avatar", src: "https://i.pravatar.cc/150?img=3", size: "md", }, }; export const Base: Story = { args: { name: "Base Avatar", src: "https://i.pravatar.cc/150?img=4", size: "base", }, }; export const Large: Story = { args: { name: "Large Avatar", src: "https://i.pravatar.cc/150?img=6", size: "lg", }, }; export const CircleShape: Story = { args: { name: "Circle Avatar", src: "https://i.pravatar.cc/150?img=7", shape: "circle", }, }; export const SquareShape: Story = { args: { name: "Square Avatar", src: "https://i.pravatar.cc/150?img=8", shape: "square", }, }; export const AllSizes: Story = { parameters: { controls: { disable: true }, }, render() { return (
); }, }; export const AllShapes: Story = { parameters: { controls: { disable: true }, }, render() { return (
); }, }; export const FallbackVariations: Story = { parameters: { controls: { disable: true }, }, render() { return (
); }, }; export const AvatarGroup: Story = { parameters: { controls: { disable: true }, }, render() { return (
); }, };