-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathStatusBanner.tsx
More file actions
49 lines (46 loc) · 1.4 KB
/
StatusBanner.tsx
File metadata and controls
49 lines (46 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
import React from "react";
import Link from "@docusaurus/Link";
import {
schemaStatus,
statusLevels,
} from "@site/src/status/status-config";
import StatusBadge from "./StatusBadge";
import styles from "./StatusBanner.module.css";
export interface StatusBannerProps {
schema: keyof typeof schemaStatus;
}
export default function StatusBanner({
schema,
}: StatusBannerProps): JSX.Element {
const info = schemaStatus[schema];
const levelInfo = statusLevels[info.level];
return (
<div className={`${styles.banner} ${styles[info.level]}`}>
<div className={styles.header}>
<StatusBadge status={info.level} linkToStatus={false} size="large" />
</div>
<p className={styles.summary}>{info.summary}</p>
{info.caveats.length > 0 && (
<div className={styles.caveats}>
<strong>Known limitations:</strong>
<ul>
{info.caveats.map((caveat, index) => (
<li key={index}>{caveat}</li>
))}
</ul>
</div>
)}
<p className={styles.note}>{levelInfo.adoptersNote}</p>
{info.referenceUrl && (
<p className={styles.reference}>
<Link to={info.referenceUrl}>
View reference implementation guide →
</Link>
</p>
)}
<p className={styles.learnMore}>
<Link to="/status">Learn more about status levels →</Link>
</p>
</div>
);
}