Merge pull request #4 from JezzWTF/jules-refactor-spinner-7897005482205256093

🧹 [Code Health] Extract duplicated SVG spinner into a shared component
This commit is contained in:
2026-04-28 15:56:40 +01:00
committed by GitHub
+12 -8
View File
@@ -35,6 +35,16 @@ const STATUS_CONFIG: Record<
error: { color: "var(--error)", label: () => "Server error — check the terminal for details." }, error: { color: "var(--error)", label: () => "Server error — check the terminal for details." },
}; };
function SpinnerIcon() {
return (
<svg className="animate-spin w-4 h-4" viewBox="0 0 24 24" fill="none">
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4" />
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" />
</svg>
);
}
export default function GenerationControls({ export default function GenerationControls({
speaker, speaker,
availableVoices, availableVoices,
@@ -237,18 +247,12 @@ export default function GenerationControls({
> >
{isGenerating ? ( {isGenerating ? (
<> <>
<svg className="animate-spin w-4 h-4" viewBox="0 0 24 24" fill="none"> <SpinnerIcon />
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4" />
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" />
</svg>
Generating... Generating...
</> </>
) : !serverReady ? ( ) : !serverReady ? (
<> <>
<svg className="animate-spin w-4 h-4" viewBox="0 0 24 24" fill="none"> <SpinnerIcon />
<circle className="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" strokeWidth="4" />
<path className="opacity-75" fill="currentColor" d="M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4z" />
</svg>
{serverStatus === "downloading" ? "Downloading model..." : "Waiting for server..."} {serverStatus === "downloading" ? "Downloading model..." : "Waiting for server..."}
</> </>
) : ( ) : (