/** * External dependencies */ import { omitBy } from 'lodash'; import type { Story } from '@storybook/react'; import { useState } from '@wordpress/element'; import { Icon } from '@wordpress/icons'; /** * Internal dependencies */ import * as icons from '../index'; const { ...availableIcons } = icons; export const Library: Story = ( args ) => { const [ filter, setFilter ] = useState( '' ); const filteredIcons = omitBy( availableIcons, ( _, name ) => { return ! name.includes( filter ); } ); return (
setFilter( event.target.value ) } />
{ Object.entries( filteredIcons ).map( ( [ name, icon ] ) => { return (
{ name }
); } ) }
); }; Library.parameters = { controls: { include: [], hideNoControlsWarning: true }, }; Library.storyName = 'Icon Library';