import * as React from 'react'
import type { StoryFn, Meta } from '@storybook/react-webpack5'
import {
    Toolbar,
    ToolbarButtonEmpty,
    ToolbarButtonGhost,
    ToolbarSectionLeft,
    ToolbarSeparator,
} from '../'

import { Filter, PlusCircle } from '@planview/pv-icons'

export default {
    title: 'pv-toolbar/Sections/ToolbarSectionLeft',
    tags: ['autodocs'],
    component: ToolbarSectionLeft,
    argTypes: {
        children: {
            name: 'children',
            description: 'Toolbar components to display in the section',
            control: false,
        },
    },
} satisfies Meta<typeof ToolbarSectionLeft>

export const Default: StoryFn<typeof ToolbarSectionLeft> = () => (
    <Toolbar label="demo">
        <ToolbarSectionLeft>
            <ToolbarButtonEmpty
                onClick={() => console.log('hit button filter')}
                icon={<Filter />}
                tooltip="Filter"
                aria-label="Filter"
            />
            <ToolbarSeparator />
            <ToolbarButtonGhost
                icon={<PlusCircle />}
                onClick={() => {
                    console.log('hit button activity')
                }}
            >
                Add Activity
            </ToolbarButtonGhost>
        </ToolbarSectionLeft>
    </Toolbar>
)

Default.storyName = 'ToolbarSectionLeft'
