File size: 715 Bytes
cd8bd0a
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
"use client";

import Tooltip from "@/shared/components/Tooltip";

type FieldLabelWithHelpProps = {
  label: string;
  help: string;
  showHelp?: boolean;
  htmlFor?: string;
};

export default function FieldLabelWithHelp({
  label,
  help,
  showHelp = true,
  htmlFor,
}: FieldLabelWithHelpProps) {
  return (
    <div className="flex items-center gap-1 mb-0.5">
      <label htmlFor={htmlFor} className="text-[10px] text-text-muted">
        {label}
      </label>
      {showHelp && (
        <Tooltip position="bottom" content={help}>
          <span className="material-symbols-outlined text-[12px] text-text-muted cursor-help">
            help
          </span>
        </Tooltip>
      )}
    </div>
  );
}