import { CSSProperties, Dispatch, SetStateAction } from 'react' import { Button, SearchInput, Toolbar, ToolbarContent, ToolbarItem, Content, ContentVariants, ToggleGroup, ToggleGroupItem, } from '@patternfly/react-core' import ListIcon from '@patternfly/react-icons/dist/esm/icons/list-icon' import ThIcon from '@patternfly/react-icons/dist/esm/icons/th-icon' interface SectionGalleryToolbarProps { /** Total count of gallery items */ galleryItemCount: number /** Current search term */ searchTerm: string /** Setter for search term */ setSearchTerm: Dispatch> /** Current layout */ layoutView: 'grid' | 'list' /** Setter for layout */ setLayoutView: Dispatch> /** Placeholder text for the gallery search input */ placeholderText?: string /** Text for the amount of gallery items */ countText?: string } export const SectionGalleryToolbar = ({ galleryItemCount, searchTerm, setSearchTerm, layoutView, setLayoutView, placeholderText = 'Search by name', countText = ' items', }: SectionGalleryToolbarProps) => ( { setSearchTerm(val) }} /> {searchTerm && ( )} } aria-label="grid icon button" isSelected={layoutView === 'grid'} onChange={() => setLayoutView('grid')} > } aria-label="list icon button" isSelected={layoutView === 'list'} onChange={() => setLayoutView('list')} > {galleryItemCount} {countText} )