chore(app): keybind tooltip component
This commit is contained in:
parent
a2857bba83
commit
3a1cfa6c73
5 changed files with 66 additions and 81 deletions
|
|
@ -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"])
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue