MCPcopy Create free account
hub / github.com/arktypeio/arktype / NotFoundSearch

Function NotFoundSearch

ark/docs/components/shell/NotFoundSearch.tsx:7–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

5
6/** a search button that starts from the last segment of the missing url */
7export const NotFoundSearch = () => {
8 const [query, setQuery] = useState<string>()
9
10 useEffect(() => {
11 const segment = location.pathname.split("/").filter(Boolean).at(-1) ?? ""
12 setQuery(
13 decodeURIComponent(segment)
14 .replace(/\.\w+$/, "")
15 .replace(/[_-]/g, " ")
16 )
17 }, [])
18
19 return <SearchButton query={query} />
20}

Callers

nothing calls this directly

Calls 3

filterMethod · 0.80
replaceMethod · 0.80
atMethod · 0.45

Tested by

no test coverage detected