import React, { ReactNode } from 'react';
import { Tooltip, TooltipProps } from '@wix/design-system';

export function MaybeTooltip(props: TooltipProps & { children?: ReactNode }) {
  const { content, children, ...rest } = props;

  if (!content) {
    return <>{children}</>;
  }

  return (
    <Tooltip content={content} {...rest}>
      {children}
    </Tooltip>
  );
}
