MCPcopy Create free account
hub / github.com/TanStack/hotkeys / RegistrationsViewer

Function RegistrationsViewer

examples/solid/createHotkeyRecorder/src/index.tsx:287–343  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

285// ---------------------------------------------------------------------------
286
287function RegistrationsViewer() {
288 const { hotkeys } = createHotkeyRegistrations()
289
290 return (
291 <section class="demo-section">
292 <h2>Live Registrations</h2>
293 <p>
294 This table is powered by <code>createHotkeyRegistrations()</code> —
295 trigger counts, names, and descriptions update in real-time as you use
296 your shortcuts.
297 </p>
298 <table class="registrations-table">
299 <thead>
300 <tr>
301 <th>Hotkey</th>
302 <th>Name</th>
303 <th>Description</th>
304 <th>Enabled</th>
305 <th>Triggers</th>
306 </tr>
307 </thead>
308 <tbody>
309 <For each={hotkeys()}>
310 {(reg) => (
311 <tr>
312 <td>
313 <kbd>{formatForDisplay(reg.hotkey)}</kbd>
314 </td>
315 <td>{reg.options.meta?.name ?? '\u2014'}</td>
316 <td class="description-cell">
317 {reg.options.meta?.description ?? '\u2014'}
318 </td>
319 <td>
320 <span
321 class={
322 reg.options.enabled !== false ? 'status-on' : 'status-off'
323 }
324 >
325 {reg.options.enabled !== false ? 'yes' : 'no'}
326 </span>
327 </td>
328 <td class="trigger-count">{reg.triggerCount}</td>
329 </tr>
330 )}
331 </For>
332 <Show when={hotkeys().length === 0}>
333 <tr>
334 <td colSpan={5} class="empty-row">
335 No hotkeys registered
336 </td>
337 </tr>
338 </Show>
339 </tbody>
340 </table>
341 </section>
342 )
343}
344

Callers

nothing calls this directly

Calls 2

formatForDisplayFunction · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…