summaryrefslogtreecommitdiffstats
path: root/src/components/FormElements/Label/Label.tsx
blob: baedff0b1a60729da88125f2757f41e2bac5031b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import styles from './Label.module.scss';

type LabelKind = 'regular' | 'settings';

const Label = ({
  body,
  htmlFor,
  required = false,
  kind = 'regular',
}: {
  body: string;
  htmlFor: string;
  required?: boolean;
  kind?: LabelKind;
}) => {
  return (
    <label htmlFor={htmlFor} className={styles[kind]}>
      {body}
      {required && <span className={styles.required}> *</span>}
    </label>
  );
};

export default Label;