mirror of
https://github.com/Athou/commafeed.git
synced 2026-03-21 21:37:29 +00:00
replace old client with new client from commafeed-ui repository
This commit is contained in:
30
commafeed-client/src/components/content/Content.tsx
Normal file
30
commafeed-client/src/components/content/Content.tsx
Normal file
@@ -0,0 +1,30 @@
|
||||
import { createStyles, Text } from "@mantine/core"
|
||||
|
||||
export interface ContentProps {
|
||||
content: string
|
||||
}
|
||||
|
||||
const useStyles = createStyles(theme => ({
|
||||
content: {
|
||||
// break long links or long words
|
||||
overflowWrap: "anywhere",
|
||||
"& a": {
|
||||
color: theme.fn.variant({ color: theme.primaryColor, variant: "subtle" }).color,
|
||||
},
|
||||
"& img": {
|
||||
maxWidth: "100%",
|
||||
height: "auto",
|
||||
},
|
||||
"& iframe": {
|
||||
maxWidth: "100%",
|
||||
},
|
||||
"& pre, & code": {
|
||||
whiteSpace: "pre-wrap",
|
||||
},
|
||||
},
|
||||
}))
|
||||
|
||||
export function Content(props: ContentProps) {
|
||||
const { classes } = useStyles()
|
||||
return <Text size="md" className={classes.content} dangerouslySetInnerHTML={{ __html: props.content }} />
|
||||
}
|
||||
Reference in New Issue
Block a user