Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
sagemathinc
GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/frontend/course/shared-project/delete-shared-project.tsx
1503 views
1
/*
2
* This file is part of CoCalc: Copyright © 2020 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Button, Card, Popconfirm } from "antd";
7
import { FormattedMessage, useIntl } from "react-intl";
8
9
import { Icon } from "@cocalc/frontend/components";
10
import { course } from "@cocalc/frontend/i18n";
11
12
export function DeleteSharedProjectPanel({ actions, settings, close }) {
13
const intl = useIntl();
14
15
if (!settings.get("shared_project_id")) {
16
return (
17
<Card
18
title={intl.formatMessage({
19
id: "course.delete-shared-project.no_shared_project",
20
defaultMessage: "No Shared Project",
21
})}
22
></Card>
23
);
24
}
25
26
return (
27
<Card
28
title={
29
<Popconfirm
30
title={intl.formatMessage({
31
id: "course.delete-shared-project.confirmation",
32
defaultMessage:
33
"Are you sure you want to delete the shared project?",
34
})}
35
okText="Yes"
36
cancelText="No"
37
onConfirm={() => {
38
actions.shared_project.delete();
39
close?.();
40
}}
41
>
42
<Button danger>
43
<Icon name="trash" />{" "}
44
{intl.formatMessage(course.delete_shared_project)}...
45
</Button>
46
</Popconfirm>
47
}
48
>
49
<FormattedMessage
50
id="course.delete-shared-project.message"
51
defaultMessage={`If you would like to delete the shared projects that was created for this course,
52
you may do so by clicking above.
53
All students will be removed from the deleted shared project.`}
54
/>
55
</Card>
56
);
57
}
58
59