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

type FieldLabelProps = {
  children: ReactNode;
  help?: ReactNode;
  className?: string;
};

export default function FieldLabel({ children, help, className = "" }: FieldLabelProps) {
  return (
    <span className={`field-label ${className}`.trim()}>
      <span className="field-label-text">{children}</span>
      {help && <InlineHelp>{help}</InlineHelp>}
    </span>
  );
}
