import { Meta, StoryObj } from '@storybook/react';
import Card from './Card';

const meta: Meta<typeof Card> = {
  component: Card,
  title: 'Components/Card',
  tags: ['autodocs'],
  parameters: {
    layout: 'centered',
  },
};

type Story = StoryObj<typeof Card>;

export const Default: Story = {
  args: {
    title: 'Default Card',
    variant: 'default',
  },
};

export const Primary: Story = {
  args: {
    title: 'Primary Card',
    variant: 'primary',
  },
};
export const Success: Story = {
  args: {
    title: 'Excel',
    variant: 'success',
    header: true,
    shadow: true,
    paddingRequired: false,
    children: <p>Power Success Card by FF-Library without padding.</p>,
  },
};
export const Warning: Story = {
  args: {
    title: 'Warning Card',
    variant: 'warning',
    shadow: true,
    contentXPosition: 'start',
    contentYPosition: 'center',
    children: <p>Power Warning Card by FF-Library</p>,
  },
};
export const Headless: Story = {
  args: {
    variant: 'default',
    header: false,
    rounded: true,
    shadow: true,
    children: 'This is a Headless Card',
  },
};
export const RoundedEdge: Story = {
  args: {
    title: 'Rounded Edge Card',
    variant: 'default',
    header: true,
    rounded: true,
  },
};
export const CardFooter: Story = {
  args: {
    title: 'Card With Footer',
    variant: 'default',
    footerContent: 'This is footer',
    header: true,
    footer: true,
    rounded: true,
  },
};
export const Controlled: Story = {
  render: () => {
    return (
      <Card
        header={true}
        footer={false}
        title="Basic Card"
        variant="default"
        shadow={true}
        contentXPosition="start"
        contentYPosition="top"
      >
        <div>
          <h2>Powering innovation & trust at 200,000+ companies worldwide</h2>
          <p>
            Empower Developers, IT Ops, and business teams to collaborate at
            high velocity. Respond to changes and deliver great customer and
            employee service experiences fast.
          </p>
          <p>
            Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do
            eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim
            ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut
            aliquip ex ea commodo consequat. Duis aute irure dolor in
            reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla
            pariatur. Excepteur sint occaecat cupidatat non proident, sunt in
            culpa qui officia deserunt mollit anim id est laborum.
          </p>
        </div>
      </Card>
    );
  },
};

export default meta;
