diff --git a/ui/src/components/ProjectProperties.tsx b/ui/src/components/ProjectProperties.tsx index 3f6f6e40..f829265a 100644 --- a/ui/src/components/ProjectProperties.tsx +++ b/ui/src/components/ProjectProperties.tsx @@ -154,6 +154,71 @@ function ProjectStatusPicker({ status, onChange }: { status: string; onChange: ( ); } +function ArchiveDangerZone({ + project, + onArchive, + archivePending, +}: { + project: Project; + onArchive: (archived: boolean) => void; + archivePending?: boolean; +}) { + const [confirming, setConfirming] = useState(false); + const isArchive = !project.archivedAt; + const action = isArchive ? "Archive" : "Unarchive"; + + return ( +
+ {isArchive + ? "Archive this project to hide it from the sidebar and project selectors." + : "Unarchive this project to restore it in the sidebar and project selectors."} +
+ {archivePending ? ( + + ) : confirming ? ( +- {project.archivedAt - ? "Unarchive this project to restore it in the sidebar and project selectors." - : "Archive this project to hide it from the sidebar and project selectors."} -
- -