import React, { useState } from 'react'
import Filter from './Filter'

export default { title: 'search/Filter' }

const FilterHooked = () => {
  const [dummyState, setDummyState] = useState(null)
  return (
    <>
      <Filter
        label='Test Filter'
        name='demo'
        attributes={[
          { key: 'Option 1' },
          { key: 'Option 2' },
          { key: 'Option 3' },
          { key: 'Option 4' }
        ]}
        value={dummyState}
        searchFilterChange={({ demo }) => {
          setDummyState(demo)
        }}
      />
      <pre>Filter: {JSON.stringify(dummyState)}</pre>
    </>
  )
}

export const filter = () => <FilterHooked />

const FilterWithDefaultValueHooked = () => {
  const [dummyState, setDummyState] = useState('Option 3')
  return (
    <>
      <Filter
        label='Test Filter'
        name='demo'
        attributes={[
          { key: 'Option 1' },
          { key: 'Option 2' },
          { key: 'Option 3' },
          { key: 'Option 4' }
        ]}
        value={dummyState}
        searchFilterChange={({ demo }) => {
          setDummyState(demo)
        }}
      />
      <pre>Tag: {JSON.stringify(dummyState)}</pre>
    </>
  )
}

export const filterWithDefaultValue = () => <FilterWithDefaultValueHooked />

const FilterColorHooked = () => {
  const [dummyState, setDummyState] = useState(null)
  return (
    <>
      <Filter
        label='Test Color Filter'
        name='colors'
        columns={2}
        attributes={[
          { key: 'Brown' },
          { key: 'Green' },
          { key: 'White' },
          { key: 'Black' },
          { key: 'Blue' },
          { key: 'Red' }
        ]}
        value={dummyState}
        searchFilterChange={({ colors }) => {
          setDummyState(colors)
        }}
      />
      <pre>Color: {JSON.stringify(dummyState)}</pre>
    </>
  )
}

export const colorFilter = () => <FilterColorHooked />
<?xml version="1.0" encoding="UTF-8"?><?xml-stylesheet type="text/xsl" href="//internationalmessage.com/wp-content/plugins/wordpress-seo/css/main-sitemap.xsl"?>
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
	<sitemap>
		<loc>https://internationalmessage.com/post-sitemap.xml</loc>
		<lastmod>2024-06-21T03:23:22+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://internationalmessage.com/page-sitemap.xml</loc>
		<lastmod>2024-06-29T07:51:49+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://internationalmessage.com/category-sitemap.xml</loc>
		<lastmod>2024-06-21T03:23:22+00:00</lastmod>
	</sitemap>
	<sitemap>
		<loc>https://internationalmessage.com/author-sitemap.xml</loc>
		<lastmod>2024-06-29T07:47:22+00:00</lastmod>
	</sitemap>
</sitemapindex>
<!-- XML Sitemap generated by Yoast SEO -->