Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

composerPathSearchState.ts

16 lines540 Bytes

1import {
2 type ComposerPathSearchState,
3 type ComposerPathSearchTarget,
4} from "@t3tools/client-runtime/state/threads";
5​
6import { useComposerPathSearch as useComposerPathSearchQuery } from "../state/queries";
7​
8export function useComposerPathSearch(target: ComposerPathSearchTarget): ComposerPathSearchState {
9 const state = useComposerPathSearchQuery(target);
10 const entries = state.entries.map((entry) => ({ path: entry.path, kind: entry.kind }));
11 return {
12 entries,
13 error: state.error,
14 isPending: state.isPending,
15 };