2024-06-13 21:54:14 +02:00
|
|
|
import { TypographyStylesProvider } from "@mantine/core"
|
|
|
|
|
import type { ReactNode } from "react"
|
2024-10-21 21:51:46 +02:00
|
|
|
import { tss } from "tss"
|
2024-06-13 21:54:14 +02:00
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* This component is used to provide basic styles to html typography elements.
|
|
|
|
|
*
|
|
|
|
|
* see https://mantine.dev/core/typography-styles-provider/
|
|
|
|
|
*/
|
2024-10-21 21:51:46 +02:00
|
|
|
|
|
|
|
|
const useStyles = tss.create(() => ({
|
|
|
|
|
// override mantine default typography styles
|
|
|
|
|
content: {
|
|
|
|
|
paddingLeft: 0,
|
|
|
|
|
"& img": {
|
|
|
|
|
marginBottom: 0,
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
}))
|
|
|
|
|
|
2024-06-13 21:54:14 +02:00
|
|
|
export const BasicHtmlStyles = (props: { children: ReactNode }) => {
|
2024-10-21 21:51:46 +02:00
|
|
|
const { classes } = useStyles()
|
|
|
|
|
return <TypographyStylesProvider className={classes.content}>{props.children}</TypographyStylesProvider>
|
2024-06-13 21:54:14 +02:00
|
|
|
}
|