CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/components/store/reset.tsx
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2022 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { Button, Form, Popconfirm } from "antd";
7
8
export function Reset({ addBox, router, form, onChange }) {
9
return (
10
<Form.Item wrapperCol={{ offset: 0, span: 24 }}>
11
{addBox}
12
{router.query.id == null && (
13
<Popconfirm
14
title="Reset all values to their default?"
15
onConfirm={() => {
16
form.resetFields();
17
onChange();
18
}}
19
>
20
<Button style={{ float: "right" }}>Reset Form</Button>
21
</Popconfirm>
22
)}
23
</Form.Item>
24
);
25
}
26
27