MCPcopy Create free account
hub / github.com/adobe/react-spectrum / createSearchOptions

Function createSearchOptions

packages/dev/s2-docs/src/searchUtils.tsx:733–745  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

731}
732
733export function createSearchOptions<
734 T extends {name: string; tags: string[]; date?: string; section?: string}
735>() {
736 return {
737 getName: (item: T) => item.name,
738 getTags: (item: T) => item.tags,
739 getDate: (item: T) => item.date,
740 shouldUseDateSort: (item: T) => {
741 const section = item.section;
742 return section === 'Blog' || section === 'Releases';
743 }
744 };
745}
746
747export function SearchEmptyState({
748 searchValue,

Callers 2

getItemsForSectionFunction · 0.85
filterSectionsFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected