This commit is contained in:
qiuchenfan 2025-11-17 19:59:04 +08:00
commit 99bbe5599c
1 changed files with 40 additions and 51 deletions

View File

@ -49,7 +49,7 @@ export function WeatherSearchForm() {
onChange={handleInputChange}
placeholder="请输入城市名称"
disabled={isLoading}
className={cn('pl-10 pr-4 py-2 pl-15 w-full text-base rounded-xl bg-slate-50/50 focus:bg-white transition-all', inputError && 'border-red-500') }
className={cn('pl-10 pr-4 py-2 w-full text-base rounded-xl bg-slate-50/50 focus:bg-white transition-all', inputError && 'border-red-500') }
/>
</div>
{inputError && (
@ -57,11 +57,8 @@ export function WeatherSearchForm() {
<AlertCircle className="inline w-4 h-4 text-red-500 mt-0.5" />
<p className="text-red-500 text-xs">{inputError}</p>
</div>
)
}
<div className='flex gap-2'>
<Button type="submit" disabled={isLoading || !city.trim()} className="mt-4 w-full">
{isLoading ? <>
@ -75,18 +72,10 @@ export function WeatherSearchForm() {
{currentWeather && (
<Button type="button" variant="outline" onClick={refreshWeather} disabled={isLoading} className="mt-4 w-full" title='刷新数据'>
<RefreshCw className={cn("w-5 h-5", isLoading && "animate-spin")} />
</Button>
)}
</div>
</form>
</div>
)
}
}