import { Badge, Tooltip } from '@based/ui'

export const meta: Based.UI.Extractor.MetaDescriptor = {
  name: 'Badge',
  group: 'Primitives',
  section: 'components',
  icon: 'edit',
  component: Badge,
  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: 'Et harum quidem rerum facilis est et expedita distinctio.',
    style: {
      size: '100%',
      frame: false,
      flex: {
        justifyContent: 'center',
        alignItems: 'center',
      },
    },
    render: () => {
      return (
        <div
          style={{
            display: 'inline-grid',
            gap: 24,
            gridTemplateColumns: 'repeat(3, auto)',
          }}
        >
          {['subtle', 'fill'].map((variant) =>
            [
              'neutral',
              'red',
              'blue',
              'green',
              'orange',
              'inverted',
              'white',
            ].map((color) =>
              [{}, { leadIcon: 'arrow-up' }, { trailIcon: 'arrow-up' }].map(
                (icon, index) => (
                  <Tooltip key={index} value={`${color}-${variant}`}>
                    <Badge
                      color={`${color}-${variant}` as any}
                      {...(icon as any)}
                    >
                      Badge
                    </Badge>
                  </Tooltip>
                ),
              ),
            ),
          )}
        </div>
      )
    },
  },
]
