import type { Meta, StoryObj } from "@storybook/react";

import { Avatar } from ".";

const meta: Meta<typeof Avatar> = {
  title: "Example/Avatar",
  component: Avatar,
};

type Story = StoryObj<typeof Avatar>;

export const Initials: Story = {
  render: () => (
    <Avatar
      user={{
        family_name: "Randall",
        given_name: "Nick",
      }}
    />
  ),
};

export const Image: Story = {
  render: () => (
    <Avatar
      user={{
        family_name: "Randall",
        profile_image_url:
          "https://images.unsplash.com/photo-1492633423870-43d1cd2775eb?&w=128&h=128&dpr=2&q=80",
        given_name: "Nick",
      }}
    />
  ),
};

export const Empty: Story = {
  render: () => <Avatar user={null} />,
};

export default meta;
