Skip to content

Commit

Permalink
wip: add search-input component
Browse files Browse the repository at this point in the history
  • Loading branch information
bouassaba committed Oct 29, 2024
1 parent 3f835c5 commit 112e0ab
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/stories/components/search-bar.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { useState } from 'react'
import { IconButton } from '@chakra-ui/react'
import { Meta, StoryObj } from '@storybook/react'
import { IconTune, SearchBar } from '../../components'
Expand All @@ -15,4 +16,8 @@ export const Default: Story = {
placeholder: 'Search',
buttons: <IconButton icon={<IconTune />} aria-label="Filters" />,
},
render: (args) => {
const [query, setQuery] = useState('')
return <SearchBar {...args} query={query} onSearch={setQuery} />
},
}
21 changes: 21 additions & 0 deletions src/stories/components/search-input.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import { useState } from 'react'
import { Meta, StoryObj } from '@storybook/react'
import { SearchInput } from '../../components'

const meta: Meta<typeof SearchInput> = {
title: 'Components/Search Input',
component: SearchInput,
}

export default meta
type Story = StoryObj<typeof SearchInput>

export const Default: Story = {
args: {
placeholder: 'Search',
},
render: (args) => {
const [query, setQuery] = useState('')
return <SearchInput {...args} query={query} onChange={setQuery} />
},
}

0 comments on commit 112e0ab

Please sign in to comment.