import { useEffect, useRef } from "preact/hooks"; import shortcuts from "../../services/shortcuts"; interface ButtonProps { text: string; className?: string; keyboardShortcut?: string; onClick: () => void; } export default function Button({ className, text, onClick, keyboardShortcut }: ButtonProps) { const classes: string[] = ["btn"]; classes.push("btn-primary"); if (className) { classes.push(className); } const buttonRef = useRef(null); const splitShortcut = (keyboardShortcut ?? "").split("+"); return ( ); }