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/title-description.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 { Divider, Form, Input } from "antd";
7
8
export function TitleDescription({ form, showExplanations, disabled = false }) {
9
return (
10
<>
11
<Divider plain>Customizable Descriptors</Divider>
12
<Form.Item
13
label="Title"
14
name="title"
15
style={{ width: "100%" }}
16
extra={
17
showExplanations ? (
18
<p>
19
Given your license a title makes it easier to keep track of. You
20
can change it at any time.
21
</p>
22
) : undefined
23
}
24
>
25
<Input
26
disabled={disabled}
27
placeholder="Enter the title of your license (optional)"
28
value={form.getFieldValue("title")}
29
onChange={(e) => {
30
form.setFieldValue({ title: e.target.value });
31
}}
32
/>
33
</Form.Item>
34
<Form.Item
35
label="Description"
36
name="description"
37
extra={
38
showExplanations ? (
39
<p>
40
Given your license a longer description to record extra
41
information that isn't always shown with the license. You can
42
change this at any time.
43
</p>
44
) : undefined
45
}
46
>
47
<Input.TextArea
48
disabled={disabled}
49
placeholder="Describe your license (optional)"
50
rows={2}
51
value={form.getFieldValue("description")}
52
onChange={(e) => {
53
form.setFieldValue({ description: e.target.value });
54
}}
55
/>
56
</Form.Item>
57
</>
58
);
59
}
60
61