keybind.tsx 437 B

1234567891011121314151617181920
  1. import type { ComponentProps, ParentProps } from "solid-js"
  2. export interface KeybindProps extends ParentProps {
  3. class?: string
  4. classList?: ComponentProps<"span">["classList"]
  5. }
  6. export function Keybind(props: KeybindProps) {
  7. return (
  8. <span
  9. data-component="keybind"
  10. classList={{
  11. ...(props.classList ?? {}),
  12. [props.class ?? ""]: !!props.class,
  13. }}
  14. >
  15. {props.children}
  16. </span>
  17. )
  18. }