11import { useState , useEffect } from 'react' ;
22import {
3- Box , Button , TextField , FormControl , InputLabel , Select , MenuItem ,
4- CircularProgress , Typography , IconButton , Slider ,
3+ Box , Button , TextField , Select , MenuItem , Typography ,
4+ CircularProgress , IconButton , Slider ,
55} from '@mui/material' ;
66import AddIcon from '@mui/icons-material/Add' ;
77import RemoveCircleOutlineIcon from '@mui/icons-material/RemoveCircleOutline' ;
8- import { Section , FormGrid , FormField , Tags , MarkdownEditor } from '@/shared/ui/index.ts' ;
8+ import { Section , FormGrid , FormField , FieldLabel , Tags , MarkdownEditor } from '@/shared/ui/index.ts' ;
99import type { Skill } from '@/entities/skill/index.ts' ;
1010
1111interface SkillFormProps {
@@ -92,18 +92,18 @@ export function SkillForm({ skill, onSubmit, onCancel, submitLabel = 'Save' }: S
9292 < Section title = "Details" >
9393 < FormGrid >
9494 < FormField fullWidth >
95+ < FieldLabel required > Title</ FieldLabel >
9596 < TextField
9697 autoFocus
9798 fullWidth
98- label = "Title"
9999 value = { title }
100100 onChange = { e => { setTitle ( e . target . value ) ; setTitleError ( false ) ; } }
101101 error = { titleError }
102102 helperText = { titleError ? 'Title is required' : undefined }
103103 />
104104 </ FormField >
105105 < FormField fullWidth >
106- < Typography variant = "caption" color = "text.secondary" sx = { { mb : 0.5 } } > Description</ Typography >
106+ < FieldLabel > Description</ FieldLabel >
107107 < MarkdownEditor value = { description } onChange = { setDescription } height = { 200 } />
108108 </ FormField >
109109 </ FormGrid >
@@ -139,7 +139,7 @@ export function SkillForm({ skill, onSubmit, onCancel, submitLabel = 'Save' }: S
139139 < Section title = "Matching" >
140140 < FormGrid >
141141 < FormField fullWidth >
142- < Typography variant = "caption" color = "text.secondary" sx = { { mb : 0.5 } } > Triggers</ Typography >
142+ < FieldLabel > Triggers</ FieldLabel >
143143 < Tags
144144 tags = { triggers }
145145 editable
@@ -148,7 +148,7 @@ export function SkillForm({ skill, onSubmit, onCancel, submitLabel = 'Save' }: S
148148 />
149149 </ FormField >
150150 < FormField fullWidth >
151- < Typography variant = "caption" color = "text.secondary" sx = { { mb : 0.5 } } > Input Hints</ Typography >
151+ < FieldLabel > Input Hints</ FieldLabel >
152152 < Tags
153153 tags = { inputHints }
154154 editable
@@ -157,7 +157,7 @@ export function SkillForm({ skill, onSubmit, onCancel, submitLabel = 'Save' }: S
157157 />
158158 </ FormField >
159159 < FormField fullWidth >
160- < Typography variant = "caption" color = "text.secondary" sx = { { mb : 0.5 } } > File Patterns</ Typography >
160+ < FieldLabel > File Patterns</ FieldLabel >
161161 < Tags
162162 tags = { filePatterns }
163163 editable
@@ -171,19 +171,15 @@ export function SkillForm({ skill, onSubmit, onCancel, submitLabel = 'Save' }: S
171171 < Section title = "Properties" >
172172 < FormGrid >
173173 < FormField >
174- < FormControl fullWidth >
175- < InputLabel > Source</ InputLabel >
176- < Select value = { source } label = "Source" onChange = { e => setSource ( e . target . value as 'user' | 'learned' ) } >
177- < MenuItem value = "user" > User</ MenuItem >
178- < MenuItem value = "learned" > Learned</ MenuItem >
179- </ Select >
180- </ FormControl >
174+ < FieldLabel > Source</ FieldLabel >
175+ < Select fullWidth value = { source } onChange = { e => setSource ( e . target . value as 'user' | 'learned' ) } >
176+ < MenuItem value = "user" > User</ MenuItem >
177+ < MenuItem value = "learned" > Learned</ MenuItem >
178+ </ Select >
181179 </ FormField >
182180 < FormField >
183181 < Box sx = { { px : 1 } } >
184- < Typography variant = "caption" color = "text.secondary" gutterBottom >
185- Confidence: { Math . round ( confidence * 100 ) } %
186- </ Typography >
182+ < FieldLabel > Confidence: { Math . round ( confidence * 100 ) } %</ FieldLabel >
187183 < Slider
188184 value = { confidence }
189185 onChange = { ( _e , v ) => setConfidence ( v as number ) }
0 commit comments