import { Meta, Story, ArgsTable, Canvas } from '@storybook/addon-docs/blocks';
import { getKnobs } from '../../../../../tools/knobsHelper';
import { TableContentFromObject, FormOutput } from '../../../../../tools/docTools';
import { headerHomeBarMock } from '../../../../../../mocks/components/header';
import HeaderHomeBar from '../HeaderHomeBar';
import { configUserLoggedInMock } from '../../../../../../mocks/config';

export const settingsDocs = {};

<Meta
    title="Global Components (Preview)/Header/Atoms/Header Home Bar"
    component={HeaderHomeBar}
    parameters={{
        layout: 'fullscreen'
    }}
/>

# HeaderHomeBar
<br />

## `HeaderHomeBar` are used to display the logo, search bar, and quick links.
<br />

### Default
<Canvas>
    <Story name="Default">
        <HeaderHomeBar
            {...headerHomeBarMock}
        />
    </Story>
</Canvas>

### With search bar
<Canvas>
    <Story name="With Search Bar">
        <HeaderHomeBar
            {...headerHomeBarMock}
            settings={getKnobs(HeaderHomeBar.schema().form)}
            displaySearchBar
        />
    </Story>
</Canvas>

### With user logged in
<Canvas>
    <Story name="With user logged in">
        <HeaderHomeBar
            {...headerHomeBarMock}
            user={configUserLoggedInMock.user}
            settings={getKnobs(HeaderHomeBar.schema().form)}
            displaySearchBar
        />
    </Story>
</Canvas>

## Usage Example
```jsx
import HeaderHomeBar from '@appdirect/sfb-theme-components/src/components/Header/atoms/header-home-bar/HeaderHomeBar';

<HeaderHomeBar />
```

## Props
<ArgsTable of={HeaderHomeBar} />

## Schema
### Form Settings
<table>
    <TableContentFromObject obj={settingsDocs} />
</table>

### Form Output
<FormOutput code={HeaderHomeBar.schema().form} />
