2021-10-13 03:05:34 +00:00
|
|
|
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"
|
|
|
|
|
|
|
|
|
2021-10-16 00:48:35 +00:00
|
|
|
export interface DescriptionBox {
|
2021-10-13 03:05:34 +00:00
|
|
|
icon: IconDefinition,
|
|
|
|
name: string,
|
|
|
|
description: string,
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2021-10-16 00:48:35 +00:00
|
|
|
export function DescriptionBox({icon, name, description}: DescriptionBox): JSX.Element {
|
2021-10-13 03:05:34 +00:00
|
|
|
return React.useMemo(
|
|
|
|
() => (
|
|
|
|
<Box>
|
|
|
|
<Heading level={3}>
|
|
|
|
<FontAwesomeIcon icon={icon}/> About <Idiomatic>{name}</Idiomatic>
|
|
|
|
</Heading>
|
|
|
|
<ReactMarkdown>
|
|
|
|
{description}
|
|
|
|
</ReactMarkdown>
|
|
|
|
</Box>
|
|
|
|
),
|
|
|
|
[icon, name, description],
|
|
|
|
)
|
|
|
|
}
|