feat: add keyboard navigation for systems

This commit is contained in:
henrygd
2025-03-05 23:35:46 -05:00
parent 5b4d5c648e
commit 0619eabec2
3 changed files with 39 additions and 5 deletions

View File

@@ -15,7 +15,16 @@ import { prependBasePath } from "@/components/router"
export function cn(...inputs: ClassValue[]) {
return twMerge(clsx(inputs))
}
// export const cn = clsx
/** Adds event listener to node and returns function that removes the listener */
export function listen<T extends Event = Event>(
node: Node,
event: string,
handler: (event: T) => void
) {
node.addEventListener(event, handler as EventListener)
return () => node.removeEventListener(event, handler as EventListener)
}
export async function copyToClipboard(content: string) {
const duration = 1500