tip-popup.tsx 791 B

12345678910111213141516171819202122232425262728293031323334
  1. import { memo } from 'react'
  2. import ShortcutsName from '../shortcuts-name'
  3. import TooltipPlus from '@/app/components/base/tooltip-plus'
  4. type TipPopupProps = {
  5. title: string
  6. children: React.ReactNode
  7. shortcuts?: string[]
  8. }
  9. const TipPopup = ({
  10. title,
  11. children,
  12. shortcuts,
  13. }: TipPopupProps) => {
  14. return (
  15. <TooltipPlus
  16. offset={4}
  17. hideArrow
  18. popupClassName='!p-0 !bg-gray-25'
  19. popupContent={
  20. <div className='flex items-center gap-1 px-2 h-6 text-xs font-medium text-gray-700 rounded-lg border-[0.5px] border-black/5'>
  21. {title}
  22. {
  23. shortcuts && <ShortcutsName keys={shortcuts} className='!text-[11px]' />
  24. }
  25. </div>
  26. }
  27. >
  28. {children}
  29. </TooltipPlus>
  30. )
  31. }
  32. export default memo(TipPopup)