import type { ReactNode } from "react";
import HoverTooltip from "../HoverTooltip";

type InlineHelpProps = {
  children: ReactNode;
  className?: string;
};

export default function InlineHelp({ children, className = "" }: InlineHelpProps) {
  if (!children) return null;
  return (
    <HoverTooltip
      content={children}
      className={`inline-help ${className}`.trim()}
      ariaLabel="i18n:govoplan-core.show_field_help.e3dfe98f"
      triggerTabIndex={-1}>
      <span className="inline-help-mark" aria-hidden="true">?</span>
    </HoverTooltip>
  );
}
