Path: blob/master/src/packages/next/components/demo-cell.tsx
1447 views
import { TAG_TO_FEATURE } from "@cocalc/util/db-schema/accounts";1import Markdown from "@cocalc/frontend/editors/slate/static-markdown";2import { FileContext } from "@cocalc/frontend/lib/file-context";34interface DemoCellProps {5tag: keyof typeof TAG_TO_FEATURE;6style?: React.CSSProperties;7}89export default function DemoCell({10tag,11style = { maxWidth: "800px", margin: "auto" },12}: Readonly<DemoCellProps>) {13const x = TAG_TO_FEATURE[tag];14if (x == null) return null;15const { language, welcome } = x;16const value = "```" + language + "\n" + (welcome ?? "2+3") + "\n```\n";17return (18<FileContext.Provider value={{ jupyterApiEnabled: true }}>19<Markdown value={value} style={style} />20</FileContext.Provider>21);22}232425