import React from 'react'
import { Card } from '../components/Card'
import type { Meta, StoryObj } from '@storybook/react'
import { ColorVariant } from '../types'

const colors: ColorVariant[] = [
  'inherit',
  'primary',
  'secondary',
  'success',
  'error',
  'info',
  'warning',
]

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

export default meta

type Story = StoryObj<typeof meta>

const defaultArgs = {}

export const BasicCard = () => <Card sx={{ minWidth: 275 }}>Content children card</Card>

export const BasicBordered = () => (
  <Card sx={{ minWidth: 275 }} border={true} color="primary">
    Card with border
  </Card>
)

export const BasicBorderedColors = () => (
  <>
    {colors.map((color, key) => (
      <Card sx={{ minWidth: 275, marginBottom: 2 }} border={true} color={color} key={key}>
        Card with border {color}
      </Card>
    ))}
  </>
)
