UNPKG

@lobehub/ui

Version:

Lobe UI is an open-source UI component library for building AIGC web apps

1 lines 1.1 kB
{"version":3,"file":"TooltipContent.mjs","names":["Hotkey"],"sources":["../../src/Tooltip/TooltipContent.tsx"],"sourcesContent":["'use client';\n\nimport { type ReactNode, memo, useMemo } from 'react';\n\nimport Hotkey, { type HotkeyProps } from '@/Hotkey';\n\ntype TooltipContentProps = {\n hotkey?: string;\n hotkeyProps?: Omit<HotkeyProps, 'keys'>;\n title: ReactNode;\n};\n\nconst TooltipContent = memo<TooltipContentProps>(({ title, hotkey, hotkeyProps }) => {\n const resolvedHotkeyProps = useMemo(\n () => ({\n compact: true,\n inverseTheme: true,\n ...hotkeyProps,\n }),\n [hotkeyProps],\n );\n\n return (\n <>\n {title}\n {hotkey ? <Hotkey keys={hotkey} {...resolvedHotkeyProps} /> : null}\n </>\n );\n});\n\nTooltipContent.displayName = 'TooltipContent';\n\nexport default TooltipContent;\n"],"mappings":";;;;;;;AAYA,MAAM,iBAAiB,MAA2B,EAAE,OAAO,QAAQ,kBAAkB;CACnF,MAAM,sBAAsB,eACnB;EACL,SAAS;EACT,cAAc;EACd,GAAG;EACJ,GACD,CAAC,YAAY,CACd;AAED,QACE,8CACG,OACA,SAAS,oBAACA;EAAO,MAAM;EAAQ,GAAI;GAAuB,GAAG,QAC7D;EAEL;AAEF,eAAe,cAAc;AAE7B,6BAAe"}