Path: blob/master/src/packages/frontend/editors/task-editor/empty-trash.tsx
1691 views
/*1* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.2* License: MS-RSL – see LICENSE.md for details3*/45/*6Button to empty the trash, thus "permanently" deleting all deleted tasks.7*/89import { React } from "../../app-framework";10import { Button, Popconfirm } from "antd";11import { TaskActions } from "./actions";1213interface Props {14actions?: TaskActions;15count: number;16}1718export const EmptyTrash: React.FC<Props> = React.memo(({ actions, count }) => {19if (actions == null) {20return <span />;21}2223return (24<Popconfirm25title="Empty the trash removing all deleted tasks?"26onConfirm={() => {27actions.stop_showing_deleted();28actions.empty_trash();29}}30>31<Button32style={{ marginTop: "3px" }}33size="small"34danger35disabled={count === 0}36>37Empty Trash ({count})38</Button>39</Popconfirm>40);41});424344