Show hotkeys on empty views

This commit is contained in:
Gregory Schier
2024-01-08 15:13:44 -08:00
parent 6f15d1352b
commit 312c01e405
8 changed files with 113 additions and 11 deletions

View File

@@ -0,0 +1,24 @@
import React from 'react';
import type { HotkeyAction } from '../../hooks/useHotkey';
import { HotKey } from './HotKey';
interface Props {
hotkeys: { action: HotkeyAction; label: string }[];
}
export const HotKeyList = ({ hotkeys }: Props) => {
return (
<div className="mx-auto h-full flex items-center text-gray-800 text-sm">
<div className="flex flex-col gap-1">
{hotkeys.map((hotkey) => (
<div key={hotkey.action} className="grid grid-cols-2">
<p>{hotkey.label}</p>
<div className="ml-auto">
<HotKey action={hotkey.action} />
</div>
</div>
))}
</div>
</div>
);
};