import React, { useState } from "react"; import { observer } from "mobx-react"; // hooks // component import { ArchiveRestore } from "lucide-react"; import { IProject } from "@plane/types"; import { CustomSelect, Loader, ToggleSwitch } from "@plane/ui"; import { SelectMonthModal } from "@/components/automation"; // icon // constants import { EUserProjectRoles, PROJECT_AUTOMATION_MONTHS } from "@/constants/project"; import { useProject, useUser } from "@/hooks/store"; // types type Props = { handleChange: (formData: Partial) => Promise; }; const initialValues: Partial = { archive_in: 1 }; export const AutoArchiveAutomation: React.FC = observer((props) => { const { handleChange } = props; // states const [monthModal, setmonthModal] = useState(false); // store hooks const { membership: { currentProjectRole }, } = useUser(); const { currentProjectDetails } = useProject(); const isAdmin = currentProjectRole === EUserProjectRoles.ADMIN; return ( <> setmonthModal(false)} handleChange={handleChange} />

Auto-archive closed issues

Plane will auto archive issues that have been completed or canceled.

currentProjectDetails?.archive_in === 0 ? handleChange({ archive_in: 1 }) : handleChange({ archive_in: 0 }) } size="sm" disabled={!isAdmin} />
{currentProjectDetails ? ( currentProjectDetails.archive_in !== 0 && (
Auto-archive issues that are closed for
{ handleChange({ archive_in: val }); }} input disabled={!isAdmin} > <> {PROJECT_AUTOMATION_MONTHS.map((month) => ( {month.label} ))}
) ) : ( )}
); });