import React from 'react';

/** Label with optional dotted underline + native title tooltip for field hints. */
export default function FieldLabel({ children, tip }) {
  if (tip) {
    return (
      <span className="studio-field-label" title={tip}>
        <span className="studio-field-label__text studio-field-label__text--tip">
          {children}
        </span>
      </span>
    );
  }
  return <span className="studio-field-label">{children}</span>;
}
