"use client";

import React from "react";
import { InfoTooltip } from "../../Tooltip/InfoTooltip";
import type { TooltipPlacement } from "../../Tooltip/Tooltip";

export interface FormTooltipProps {
  id: string;
  children?: React.ReactNode;
  className?: string;
  placement?: TooltipPlacement;
  [key: string]: any;
}
const FormTooltip: React.FC<FormTooltipProps> = ({
  id,
  children,
  placement = "right",
  ...other
}) => {
  return children ? (
    <>
      &nbsp;
      <InfoTooltip
        id={`${id}-tooltip`}
        className="form-field__tooltip"
        placement={placement}
        {...other}
      >
        {children}
      </InfoTooltip>
    </>
  ) : null;
};

FormTooltip.displayName = "FormTooltip";

export { FormTooltip };
