import React, { useState } from "react"; import { observer } from "mobx-react-lite"; // hooks import { useProject, useUser } from "hooks/store"; // component import { CustomSelect, Loader, ToggleSwitch } from "@plane/ui"; import { SelectMonthModal } from "components/automation"; // icon import { ArchiveRestore } from "lucide-react"; // constants import { EUserProjectRoles, PROJECT_AUTOMATION_MONTHS } from "constants/project"; // types import { IProject } from "@plane/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 cancelled.

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} ))}
) ) : ( )}
); });