shortcuts-name.tsx 635 B

1234567891011121314151617181920212223242526272829303132
  1. import { memo } from 'react'
  2. import { getKeyboardKeyNameBySystem } from './utils'
  3. import cn from '@/utils/classnames'
  4. type ShortcutsNameProps = {
  5. keys: string[]
  6. className?: string
  7. }
  8. const ShortcutsName = ({
  9. keys,
  10. className,
  11. }: ShortcutsNameProps) => {
  12. return (
  13. <div className={cn(
  14. 'flex items-center gap-0.5 h-4 text-xs text-gray-400',
  15. className,
  16. )}>
  17. {
  18. keys.map(key => (
  19. <div
  20. key={key}
  21. className='capitalize'
  22. >
  23. {getKeyboardKeyNameBySystem(key)}
  24. </div>
  25. ))
  26. }
  27. </div>
  28. )
  29. }
  30. export default memo(ShortcutsName)