MCPcopy Index your code
hub / github.com/triggerdotdev/jsonhero-web / PathHistoryControls

Function PathHistoryControls

app/components/PathBar.tsx:137–175  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

135}
136
137export function PathHistoryControls() {
138 const { canGoBack, canGoForward } = useJsonColumnViewState();
139 const { goBack, goForward } = useJsonColumnViewAPI();
140
141 useHotkeys(
142 "[",
143 () => {
144 goBack();
145 },
146 [goBack]
147 );
148
149 useHotkeys(
150 "]",
151 () => {
152 goForward();
153 },
154 [goForward]
155 );
156
157 return (
158 <div className="flex h-full">
159 <button
160 className="flex justify-center items-center w-[26px] h-[26px] disabled:text-slate-400 disabled:text-opacity-50 text-slate-700 hover:bg-slate-300 hover:disabled:bg-transparent rounded-sm transition dark:disabled:text-slate-700 dark:text-slate-400 dark:hover:bg-white dark:hover:bg-opacity-[5%] dark:hover:disabled:bg-transparent"
161 disabled={!canGoBack}
162 onClick={goBack}
163 >
164 <ArrowLeftIcon className="w-5 h-6" />
165 </button>
166 <button
167 className="flex justify-center items-center w-[26px] h-[26px] disabled:text-slate-400 disabled:text-opacity-50 text-slate-700 hover:bg-slate-300 hover:disabled:bg-transparent rounded-sm transition dark:disabled:text-slate-700 dark:text-slate-400 dark:hover:bg-white dark:hover:bg-opacity-[5%] dark:hover:disabled:bg-transparent"
168 disabled={!canGoForward}
169 onClick={goForward}
170 >
171 <ArrowRightIcon className="w-5 h-6" />
172 </button>
173 </div>
174 );
175}
176
177function PathBarElement({
178 node,

Callers

nothing calls this directly

Calls 2

useJsonColumnViewStateFunction · 0.90
useJsonColumnViewAPIFunction · 0.90

Tested by

no test coverage detected