chore(app): keybind tooltip component

This commit is contained in:
Adam
2025-12-31 11:24:45 -06:00
parent a2857bba83
commit 3a1cfa6c73
5 changed files with 66 additions and 81 deletions

View File

@@ -8,6 +8,26 @@ export interface TooltipProps extends ComponentProps<typeof KobalteTooltip> {
inactive?: boolean
}
export interface TooltipKeybindProps extends Omit<TooltipProps, "value"> {
title: string
keybind: string
}
export function TooltipKeybind(props: TooltipKeybindProps) {
const [local, others] = splitProps(props, ["title", "keybind"])
return (
<Tooltip
{...others}
value={
<div data-slot="tooltip-keybind">
<span>{local.title}</span>
<span data-slot="tooltip-keybind-key">{local.keybind}</span>
</div>
}
/>
)
}
export function Tooltip(props: TooltipProps) {
const [open, setOpen] = createSignal(false)
const [local, others] = splitProps(props, ["children", "class", "inactive"])