import { IconButton } from '@based/ui'

export const meta: Based.UI.Extractor.MetaDescriptor = {
  name: 'Icon Button',
  group: 'Interactables',
  section: 'components',
  icon: 'edit',
  component: IconButton,
  subtitle:
    'Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.',
  showApi: true,
  showUsage: true,
}

export const blocks: Based.UI.Extractor.BlocksDescriptor[] = [
  {
    name: 'Default',
    type: 'component',
    description: 'Default IconButton with various sizes and states.',
    style: {
      size: 'small',
      frame: false,
      flex: {
        justifyContent: 'center',
        alignItems: 'center',
      },
    },
    render: () => <IconButton icon="close" size="regular" tooltip="Close" />,
  },
  {
    name: 'With trail icon',
    type: 'component',
    description: 'Default IconButton with various sizes and states.',
    style: {
      size: 'small',
      frame: false,
      flex: {
        justifyContent: 'center',
        alignItems: 'center',
      },
    },
    render: () => (
      <IconButton
        icon="text-styling"
        trailChevron="down"
        size="regular"
        tooltip="Text styles"
      />
    ),
  },
  {
    name: 'Small',
    type: 'component',
    description: 'Default IconButton with various sizes and states.',
    style: {
      size: 'small',
      frame: false,
      flex: {
        justifyContent: 'center',
        alignItems: 'center',
      },
    },
    render: () => <IconButton icon="close" size="small" tooltip="Close" />,
  },
  {
    name: 'Tiny',
    type: 'component',
    description: 'Default IconButton with various sizes and states.',
    style: {
      size: 'small',
      frame: false,
      flex: {
        justifyContent: 'center',
        alignItems: 'center',
      },
    },
    render: () => <IconButton icon="close" size="tiny" tooltip="Close" />,
  },
  {
    name: 'Loading',
    type: 'component',
    description: 'Default IconButton with various sizes and states.',
    style: {
      size: 'small',
      frame: false,
      flex: {
        justifyContent: 'center',
        alignItems: 'center',
      },
    },
    render: () => (
      <IconButton icon="close" loading size="regular" tooltip="Open" />
    ),
  },
  {
    name: 'Disabled',
    type: 'component',
    description: 'Default IconButton with various sizes and states.',
    style: {
      size: 'small',
      frame: false,
      flex: {
        justifyContent: 'center',
        alignItems: 'center',
      },
    },
    render: () => <IconButton icon="show" disabled size="regular" />,
  },
  {
    name: 'Red',
    type: 'component',
    description: 'Default IconButton with various sizes and states.',
    style: {
      size: 'small',
      frame: false,
      flex: {
        justifyContent: 'center',
        alignItems: 'center',
      },
    },
    render: () => (
      <IconButton icon="delete" color="red" size="regular" tooltip="Delete" />
    ),
  },
]
