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/misc/edit-row.tsx
Views: 687
1
import { CSSProperties, ReactNode } from "react";
2
3
interface Props {
4
label: ReactNode;
5
description?: ReactNode;
6
children: ReactNode;
7
style?: CSSProperties;
8
}
9
10
export default function EditRow({
11
label,
12
description,
13
children,
14
style,
15
}: Props) {
16
return (
17
<div style={{ marginBottom: "20px", ...style }}>
18
<h4>{label}</h4>
19
{description == null ? (
20
children
21
) : (
22
<div style={{ width: "100%" }}>
23
{children}
24
<div style={{ color: "#666", fontSize: "10pt", marginTop: "10px" }}>
25
{description}
26
</div>
27
</div>
28
)}
29
</div>
30
);
31
}
32
33