mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-05-05 22:02:39 +02:00
feat: enhance sidebar and toolbar components with shortcut key display, improving user interaction and accessibility
This commit is contained in:
parent
b98dbf8952
commit
7a1e24fc52
4 changed files with 70 additions and 24 deletions
23
surfsense_web/components/ui/shortcut-kbd.tsx
Normal file
23
surfsense_web/components/ui/shortcut-kbd.tsx
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
import { cn } from "@/lib/utils";
|
||||
|
||||
interface ShortcutKbdProps {
|
||||
keys: string[];
|
||||
className?: string;
|
||||
}
|
||||
|
||||
export function ShortcutKbd({ keys, className }: ShortcutKbdProps) {
|
||||
if (keys.length === 0) return null;
|
||||
|
||||
return (
|
||||
<span className={cn("ml-2 inline-flex items-center gap-0.5 text-white/50", className)}>
|
||||
{keys.map((key) => (
|
||||
<kbd
|
||||
key={key}
|
||||
className="inline-flex size-[16px] items-center justify-center rounded-[3px] bg-white/[0.08] font-sans text-[10px] leading-none"
|
||||
>
|
||||
{key}
|
||||
</kbd>
|
||||
))}
|
||||
</span>
|
||||
);
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue