1
Fork 0
mirror of https://github.com/Steffo99/sophon.git synced 2025-01-08 23:09:47 +00:00
sophon/frontend/src/components/elements/DescriptionBox.tsx
Stefano Pigozzi b44f7b4ebf 💥 Dockerize everything! (#74 closes #59)
*  Create Dockerfile for the backend

* 🔧 Limit the allowed slug values

*  Create docker image for the proxy

*  Add serve script (and serve dependency)

*  Add .dockerignore symlinks to .gitignore

*  Create docker image for the frontend

* 🔧 Proxy the frontend

* 🔧 Configure the proxy.dbm directory

* 🚧 WIP

* 💥 Improve settings handling

* 💥 Prepare backend for docker deployment

* 🔧 Reserve `static` notebook slug

*  Make static work

* 🐛 Set a default value for reduce

* 💥 Things

* 💥 Everything works!
2021-10-19 22:41:18 +02:00

37 lines
1.1 KiB
TypeScript

import {IconDefinition} from "@fortawesome/fontawesome-svg-core"
import {FontAwesomeIcon} from "@fortawesome/react-fontawesome"
import {Box, Heading, Idiomatic} from "@steffo/bluelib-react"
import * as React from "react"
import ReactMarkdown from "react-markdown"
import {Empty} from "./Empty"
export interface DescriptionBoxProps {
icon: IconDefinition,
name: string,
description?: string | null,
}
export function DescriptionBox({icon, name, description}: DescriptionBoxProps): JSX.Element {
return React.useMemo(
() => (
<Box>
<Heading level={3}>
<FontAwesomeIcon icon={icon}/>&nbsp;About <Idiomatic>{name}</Idiomatic>
</Heading>
{
description ?
<ReactMarkdown>
{description}
</ReactMarkdown>
:
<Empty>
This resource has no about text.
</Empty>
}
</Box>
),
[icon, name, description],
)
}