import { PropsWithChildren } from 'react';

import { Tooltip } from '@/components/tooltip/Tooltip';

type Props = {
  isTooltipEnabled: boolean;
  label: string;
};
export const ConditionalTooltip = ({
  isTooltipEnabled,
  label,
  children,
}: PropsWithChildren<Props>) => {
  return isTooltipEnabled ? (
    <Tooltip label={label}>
      <div className='cursor-pointer'>{children}</div>
    </Tooltip>
  ) : (
    children
  );
};
