File tree Expand file tree Collapse file tree 1 file changed +27
-2
lines changed
src/components/common/label Expand file tree Collapse file tree 1 file changed +27
-2
lines changed Original file line number Diff line number Diff line change 1- export const Label = ( ) => {
2- return < label > </ label >
1+ import clsx from 'clsx'
2+
3+ export interface LabelProps
4+ extends React . LabelHTMLAttributes < HTMLLabelElement > {
5+ required ?: boolean
6+ labelText ?: string
7+ }
8+
9+ export const Label = ( {
10+ required = false ,
11+ labelText,
12+ htmlFor,
13+ children,
14+ className = '' ,
15+ } : LabelProps ) => {
16+ const labelClass = clsx ( 'flex flex-col' , className )
17+ const requiredClass = 'text-body3 font-medium text-primary-normal'
18+
19+ return (
20+ < label htmlFor = { htmlFor } className = { labelClass } >
21+ < div className = 'mb-4 flex items-center' >
22+ < span className = 'font-medium text-gray-600' > { labelText } </ span >
23+ { required && < span className = { requiredClass } > *</ span > }
24+ </ div >
25+ { children }
26+ </ label >
27+ )
328}
You can’t perform that action at this time.
0 commit comments