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/frontend/course/handouts/handout-info-header.tsx
Views: 687
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 { Col, Row } from "antd";
7
import { Tip } from "@cocalc/frontend/components";
8
9
interface StudentHandoutInfoHeaderProps {
10
title: string;
11
}
12
13
export function StudentHandoutInfoHeader({
14
title,
15
}: StudentHandoutInfoHeaderProps) {
16
function render_col(step_number, key, width) {
17
const title = "Distribute to Student";
18
const tip =
19
"This column gives the status whether a handout was received by a student and lets you copy the handout to one student at a time.";
20
return (
21
<Col md={width} key={key}>
22
<Tip title={title} tip={tip}>
23
<b>
24
{step_number}. {title}
25
</b>
26
</Tip>
27
</Col>
28
);
29
}
30
31
function render_headers() {
32
return <Row>{render_col(1, "last_handout", 24)}</Row>;
33
}
34
35
const tip =
36
title === "Handout"
37
? "This column gives the directory name of the handout."
38
: "This column gives the name of the student.";
39
40
return (
41
<div>
42
<Row style={{ borderBottom: "2px solid #aaa" }}>
43
<Col md={4} key="title">
44
<Tip title={title} tip={tip}>
45
<b>{title}</b>
46
</Tip>
47
</Col>
48
<Col md={20} key="rest">
49
{render_headers()}
50
</Col>
51
</Row>
52
</div>
53
);
54
}
55
56