* style: improved profile settings * chore: minor improvements * style: improved workspace settings * style: workspace settings content * style: improved project settings * fix: project settings flat map * chore: add back navigation from settings pages * style: settings content * style: estimates list * refactor: remove old code * refactor: removed unnecessary line breaks * refactor: create a common component for page header * chore: add fade-in animation to sidebar * fix: formatting * fix: project settings sidebar header * fix: workspace settings sidebar header * fix: settings content wrapper scroll * chore: separate project settings features * fix: formatting * refactor: custom theme selector * refactor: settings headings * refactor: settings headings * fix: project settings sidebar padding * fix: sidebar header padding * fix: sidebar item permissions * fix: missing editable check * refactor: remove unused files * chore: remove unnecessary code * chore: add missing translations * fix: formatting
46 lines
1.5 KiB
TypeScript
46 lines
1.5 KiB
TypeScript
import { useState } from "react";
|
|
import { observer } from "mobx-react";
|
|
// plane imports
|
|
import { WORKSPACE_TRACKER_ELEMENTS } from "@plane/constants";
|
|
import { useTranslation } from "@plane/i18n";
|
|
import { Button } from "@plane/propel/button";
|
|
import type { IWorkspace } from "@plane/types";
|
|
// components
|
|
import { SettingsBoxedControlItem } from "@/components/settings/boxed-control-item";
|
|
// local imports
|
|
import { DeleteWorkspaceModal } from "./delete-workspace-modal";
|
|
|
|
type TDeleteWorkspace = {
|
|
workspace: IWorkspace | null;
|
|
};
|
|
|
|
export const DeleteWorkspaceSection = observer(function DeleteWorkspaceSection(props: TDeleteWorkspace) {
|
|
const { workspace } = props;
|
|
// states
|
|
const [deleteWorkspaceModal, setDeleteWorkspaceModal] = useState(false);
|
|
// translation
|
|
const { t } = useTranslation();
|
|
|
|
return (
|
|
<>
|
|
<DeleteWorkspaceModal
|
|
data={workspace}
|
|
isOpen={deleteWorkspaceModal}
|
|
onClose={() => setDeleteWorkspaceModal(false)}
|
|
/>
|
|
<SettingsBoxedControlItem
|
|
title={t("workspace_settings.settings.general.delete_workspace")}
|
|
description={t("workspace_settings.settings.general.delete_workspace_description")}
|
|
control={
|
|
<Button
|
|
variant="error-outline"
|
|
onClick={() => setDeleteWorkspaceModal(true)}
|
|
data-ph-element={WORKSPACE_TRACKER_ELEMENTS.DELETE_WORKSPACE_BUTTON}
|
|
>
|
|
{t("delete")}
|
|
</Button>
|
|
}
|
|
/>
|
|
</>
|
|
);
|
|
});
|