mirror of
https://github.com/docmost/docmost.git
synced 2026-05-21 01:04:39 +08:00
fix badge
This commit is contained in:
@@ -21,24 +21,44 @@ import { formattedDate } from "@/lib/time";
|
|||||||
import NoTableResults from "@/components/common/no-table-results";
|
import NoTableResults from "@/components/common/no-table-results";
|
||||||
import { useConfluenceImportsQuery } from "@/ee/confluence-import/queries/confluence-import-queries";
|
import { useConfluenceImportsQuery } from "@/ee/confluence-import/queries/confluence-import-queries";
|
||||||
|
|
||||||
|
const BADGE_STYLES = {
|
||||||
|
root: { flexShrink: 0 },
|
||||||
|
label: { overflow: "visible" as const },
|
||||||
|
};
|
||||||
|
|
||||||
function statusBadge(status: ConfluenceImportStatus, cancelled: boolean) {
|
function statusBadge(status: ConfluenceImportStatus, cancelled: boolean) {
|
||||||
if (cancelled) {
|
if (cancelled) {
|
||||||
return (
|
return (
|
||||||
<Badge color="gray" variant="light" leftSection={<IconX size={12} />}>
|
<Badge
|
||||||
|
color="gray"
|
||||||
|
variant="light"
|
||||||
|
leftSection={<IconX size={12} />}
|
||||||
|
styles={BADGE_STYLES}
|
||||||
|
>
|
||||||
Cancelled
|
Cancelled
|
||||||
</Badge>
|
</Badge>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (status === "processing") {
|
if (status === "processing") {
|
||||||
return (
|
return (
|
||||||
<Badge color="blue" variant="light" leftSection={<Loader size={10} />}>
|
<Badge
|
||||||
|
color="blue"
|
||||||
|
variant="light"
|
||||||
|
leftSection={<Loader size={10} />}
|
||||||
|
styles={BADGE_STYLES}
|
||||||
|
>
|
||||||
Running
|
Running
|
||||||
</Badge>
|
</Badge>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
if (status === "success") {
|
if (status === "success") {
|
||||||
return (
|
return (
|
||||||
<Badge color="teal" variant="light" leftSection={<IconCheck size={12} />}>
|
<Badge
|
||||||
|
color="teal"
|
||||||
|
variant="light"
|
||||||
|
leftSection={<IconCheck size={12} />}
|
||||||
|
styles={BADGE_STYLES}
|
||||||
|
>
|
||||||
Completed
|
Completed
|
||||||
</Badge>
|
</Badge>
|
||||||
);
|
);
|
||||||
@@ -48,6 +68,7 @@ function statusBadge(status: ConfluenceImportStatus, cancelled: boolean) {
|
|||||||
color="red"
|
color="red"
|
||||||
variant="light"
|
variant="light"
|
||||||
leftSection={<IconAlertCircle size={12} />}
|
leftSection={<IconAlertCircle size={12} />}
|
||||||
|
styles={BADGE_STYLES}
|
||||||
>
|
>
|
||||||
Failed
|
Failed
|
||||||
</Badge>
|
</Badge>
|
||||||
|
|||||||
Reference in New Issue
Block a user