import {
  Meta,
  Story,
  Preview,
  Title,
  Subtitle,
  Description,
  Props,
} from '@storybook/addon-docs/blocks';
import { withKnobs } from '@storybook/addon-knobs';

import { Box } from '@material-ui/core';

import { Tabs } from '../';
import { TabsStory } from './tabs.stories.js';

<Meta title='Originals/Tabs' component={Tabs} decorators={[withKnobs]}/>

<Title>Tabs</Title>

<Description>
  Componente de abas dos aplicativos Eureca
</Description>

<Preview>
  <Story name="Tabs">
    <TabsStory />
  </Story>
</Preview>

<Subtitle>Props</Subtitle>

|   Nome  |            Descrição            |   Default   |
|:-------:|:-------------------------------:|:-----------:|
| items | Array de objetos com as opções de abas.  <br /> 'array' | - |
| current | Aba selecionada  <br /> 'string' | 0 |
| onChange | Função disparada ao se selecionar uma aba. Retorna a nova aba.   <br /> 'func' | () => { } |

<Subtitle>Formato do arquivo de entrada</Subtitle>

Cada objeto possui as chaves:

- `value`: string \| number
- `label`: string \| object \| element
- `disabled`: bool

```jsx
[
  { value: '0', label: 'Online', disabled: false },
  { value: '1', label: 'Presencial', disabled: false },
  { value: '2', label: 'Entrevista', disabled: true },
]
```

<Subtitle>Exemplo de Aplicação</Subtitle>

```jsx
<Tabs
  items={items}
  current={currentTab}
  onChange={v => setActiveTab(v)}
/>
```