@@ -117,25 +117,29 @@ const CustomModelSection = ({ isNew, onChange, model: customModel }: CustomModel
117117 const [ outputPrice , setOutputPrice ] = useState < number > ( customModel ?. outputPrice || 0 ) ;
118118 const [ modelName , setModelName ] = useState ( customModel ?. name || "" ) ;
119119
120- const baseInputClassName = "bg-transparent p-1 focus:outline-none mt-[4px]" ;
121- const modelNameInputClassName = `${ baseInputClassName } text-sm text-default-900 font-medium flex-1 truncate` ;
122- const labelClassName = `${ baseInputClassName } text-xs text-default-900 w-auto` ;
123- const detailInputClassName = `${ baseInputClassName } flex-1 noselect focus:outline-none
124- rnd-cancel px-2 py-1 border !border-gray-200 dark:!border-default-200 rounded-md
125- text-xs text-default-700 dark:text-default-300 placeholder:text-default-400 disabled:opacity-70 disabled:cursor-not-allowed` ;
120+ const baseClassName = "bg-transparent p-1 focus:outline-none disabled:opacity-70 disabled:cursor-not-allowed" ;
121+ const modelNameInputClassName = `${ baseClassName } text-sm text-default-900 font-medium flex-1 truncate rnd-cancel px-2 py-1 border !border-gray-200 dark:!border-default-200 rounded-md mr-1` ;
122+ const labelClassName = `${ baseClassName } text-xs text-default-900 w-auto` ;
123+ const detailInputClassName = `${ baseClassName } flex-1 noselect focus:outline-none rnd-cancel px-2 py-1 border !border-gray-200 dark:!border-default-200 rounded-md
124+ text-xs text-default-700 placeholder:text-default-400` ;
126125
127126 const handleOnChange = ( isDelete : boolean ) => {
128- if ( modelName . length < 1 || slug . length < 1 || baseUrl . length < 1 || apiKey . length < 1 ) {
127+ if (
128+ modelName . trim ( ) . length < 1 ||
129+ slug . trim ( ) . length < 1 ||
130+ baseUrl . trim ( ) . length < 1 ||
131+ apiKey . trim ( ) . length < 1
132+ ) {
129133 return ;
130134 }
131135
132136 onChange (
133137 {
134138 id : id ,
135- name : modelName ,
136- baseUrl : baseUrl ,
137- slug : slug ,
138- apiKey : apiKey ,
139+ name : modelName . trim ( ) ,
140+ baseUrl : baseUrl . trim ( ) ,
141+ slug : slug . trim ( ) ,
142+ apiKey : apiKey . trim ( ) ,
139143 contextWindow : contextWindow ,
140144 maxOutput : maxOutput ,
141145 inputPrice : inputPrice ,
@@ -165,7 +169,7 @@ const CustomModelSection = ({ isNew, onChange, model: customModel }: CustomModel
165169 placeholder = "My Model"
166170 type = "text"
167171 disabled = { ! isEditing }
168- onChange = { ( e ) => setModelName ( e . target . value . trim ( ) ) }
172+ onChange = { ( e ) => setModelName ( e . target . value ) }
169173 > </ input >
170174
171175 { isNew ? (
@@ -198,39 +202,39 @@ const CustomModelSection = ({ isNew, onChange, model: customModel }: CustomModel
198202 ) }
199203 </ div >
200204
201- < div className = "flex flex-row" >
205+ < div className = "flex flex-row mt-[4px] " >
202206 < label className = { labelClassName } > Slug</ label >
203207 < input
204208 className = { detailInputClassName }
205209 value = { slug }
206- placeholder = "e.g., google/ gemini-2.5-flash"
210+ placeholder = "e.g., gemini-2.5-flash"
207211 type = "text"
208212 disabled = { ! isEditing }
209- onChange = { ( e ) => setSlug ( e . target . value . trim ( ) ) }
213+ onChange = { ( e ) => setSlug ( e . target . value ) }
210214 />
211215 </ div >
212216
213- < div className = "flex flex-row" >
217+ < div className = "flex flex-row mt-[4px] " >
214218 < label className = { labelClassName } > Base URL</ label >
215219 < input
216220 className = { detailInputClassName }
217221 value = { baseUrl }
218222 placeholder = "An OpenAI-compatible endpoint"
219223 type = "text"
220224 disabled = { ! isEditing }
221- onChange = { ( e ) => setBaseUrl ( e . target . value . trim ( ) ) }
225+ onChange = { ( e ) => setBaseUrl ( e . target . value ) }
222226 />
223227 </ div >
224228
225- < div className = "flex flex-row" >
229+ < div className = "flex flex-row mt-[4px] " >
226230 < label className = { labelClassName } > API Key</ label >
227231 < input
228232 className = { detailInputClassName }
229233 value = { apiKey }
230234 placeholder = "Your API Key"
231235 type = { ! isEditing && ! isNew ? "password" : "text" }
232236 disabled = { ! isEditing }
233- onChange = { ( e ) => setApiKey ( e . target . value . trim ( ) ) }
237+ onChange = { ( e ) => setApiKey ( e . target . value ) }
234238 />
235239 </ div >
236240
0 commit comments