mirror of
https://github.com/fosrl/pangolin.git
synced 2026-05-15 04:39:54 +00:00
improve cert status style
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
"use client";
|
||||
|
||||
import { Button } from "@/components/ui/button";
|
||||
import { RotateCw } from "lucide-react";
|
||||
import { Loader2, RotateCw } from "lucide-react";
|
||||
import { useCertificate } from "@app/hooks/useCertificate";
|
||||
import { useTranslations } from "next-intl";
|
||||
|
||||
@@ -78,7 +78,11 @@ export default function CertificateStatus({
|
||||
{t("certificateStatus")}:
|
||||
</span>
|
||||
)}
|
||||
<span className="text-sm text-muted-foreground">
|
||||
<span className="inline-flex items-center gap-1.5 text-sm text-muted-foreground">
|
||||
<Loader2
|
||||
className="h-3.5 w-3.5 shrink-0 animate-spin"
|
||||
aria-hidden
|
||||
/>
|
||||
{t("loading")}
|
||||
</span>
|
||||
</div>
|
||||
|
||||
@@ -47,18 +47,18 @@ export function useCertificate({
|
||||
if (showLoading) {
|
||||
setCertLoading(true);
|
||||
}
|
||||
setCertError(null);
|
||||
try {
|
||||
const res = await api.get<
|
||||
AxiosResponse<GetCertificateResponse>
|
||||
>(`/org/${orgId}/certificate/${domainId}/${fullDomain}`);
|
||||
const certData = res.data.data;
|
||||
if (certData) {
|
||||
setCertError(null);
|
||||
setCert(certData);
|
||||
}
|
||||
} catch (error: any) {
|
||||
console.error("Failed to fetch certificate:", error);
|
||||
setCertError("Failed to fetch certificate");
|
||||
setCertError("Failed");
|
||||
} finally {
|
||||
if (showLoading) {
|
||||
setCertLoading(false);
|
||||
@@ -84,7 +84,7 @@ export function useCertificate({
|
||||
}, 500);
|
||||
} catch (error: any) {
|
||||
console.error("Failed to restart certificate:", error);
|
||||
setCertError("Failed to restart certificate");
|
||||
setCertError("Failed to restart");
|
||||
} finally {
|
||||
setRefreshing(false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user