import { Button, IconButton, Tooltip } from '@based/ui'

export const meta: Based.UI.Extractor.MetaDescriptor = {
  name: 'Tooltip',
  group: 'Overlays',
  section: 'components',
  icon: 'edit',
  component: Tooltip,
  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: 'OnButton',
    type: 'component',
    description: 'Tooltip displayed on a Button component with a key hint.',
    style: {
      size: 'small',
      frame: false,
      flex: {
        justifyContent: 'center',
        alignItems: 'center',
      },
    },
    render: () => {
      return (
        <Tooltip value="Send message" keyHint="Enter">
          <Button>Send message</Button>
        </Tooltip>
      )
    },
  },
  {
    name: 'OnIconButton',
    type: 'component',
    description:
      'Tooltip displayed on an IconButton component with a key hint.',
    style: {
      size: 'small',
      frame: false,
      flex: {
        justifyContent: 'center',
        alignItems: 'center',
      },
    },
    render: () => {
      return (
        <Tooltip value="Close" keyHint="Esc">
          <IconButton icon="close" />
        </Tooltip>
      )
    },
  },
]
