mirror of
https://github.com/MODSetter/SurfSense.git
synced 2026-07-26 23:51:14 +02:00
feat(models-selection-panel): enhance refresh button with spinner for loading state
This commit is contained in:
parent
b8d0346371
commit
fe1bee14ed
1 changed files with 4 additions and 1 deletions
|
|
@ -2,6 +2,7 @@ import { RefreshCw } from "lucide-react";
|
||||||
import { useState } from "react";
|
import { useState } from "react";
|
||||||
import { Button } from "@/components/ui/button";
|
import { Button } from "@/components/ui/button";
|
||||||
import { Checkbox } from "@/components/ui/checkbox";
|
import { Checkbox } from "@/components/ui/checkbox";
|
||||||
|
import { Spinner } from "@/components/ui/spinner";
|
||||||
import {
|
import {
|
||||||
capability,
|
capability,
|
||||||
capabilityLabels,
|
capabilityLabels,
|
||||||
|
|
@ -124,8 +125,10 @@ export function ModelsSelectionPanel({
|
||||||
type="button"
|
type="button"
|
||||||
onClick={onRefresh}
|
onClick={onRefresh}
|
||||||
disabled={isRefreshing || isRefreshDisabled}
|
disabled={isRefreshing || isRefreshDisabled}
|
||||||
|
className="relative"
|
||||||
>
|
>
|
||||||
{isRefreshing ? "Refreshing..." : "Refresh"}
|
<span className={isRefreshing ? "opacity-0" : ""}>Reload models</span>
|
||||||
|
{isRefreshing ? <Spinner size="sm" className="absolute" /> : null}
|
||||||
</Button>
|
</Button>
|
||||||
) : null}
|
) : null}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue