-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy patharchive-workspace.tsx
33 lines (30 loc) · 1.12 KB
/
archive-workspace.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
import { Card, CardBody, Button, Text } from "@stacklok/ui-kit";
import { twMerge } from "tailwind-merge";
import { useRestoreWorkspaceButton } from "../hooks/use-restore-workspace-button";
import { useArchiveWorkspaceButton } from "../hooks/use-archive-workspace-button";
export function ArchiveWorkspace({
className,
workspaceName,
isArchived,
}: {
workspaceName: string;
className?: string;
isArchived: boolean | undefined;
}) {
const restoreButtonProps = useRestoreWorkspaceButton({ workspaceName });
const archiveButtonProps = useArchiveWorkspaceButton({ workspaceName });
return (
<Card className={twMerge(className, "shrink-0")}>
<CardBody className="flex justify-between items-center">
<div>
<Text className="text-primary">Archive Workspace</Text>
<Text className="flex items-center text-secondary mb-0">
Archiving this workspace removes it from the main workspaces list,
though it can be restored if needed.
</Text>
</div>
<Button {...(isArchived ? restoreButtonProps : archiveButtonProps)} />
</CardBody>
</Card>
);
}