memoize feed entry content because Interweave is costly

This commit is contained in:
Athou
2023-06-25 20:58:15 +02:00
parent 488a88fe95
commit 6ebe0fa827
2 changed files with 11 additions and 6 deletions

View File

@@ -1,4 +1,5 @@
import { Box } from "@mantine/core"
import { useAppSelector } from "app/store"
import { Entry } from "app/types"
import { Content } from "./Content"
import { Enclosure } from "./Enclosure"
@@ -9,10 +10,11 @@ export interface FeedEntryBodyProps {
}
export function FeedEntryBody(props: FeedEntryBodyProps) {
const search = useAppSelector(state => state.entries.search)
return (
<Box>
<Box>
<Content content={props.entry.content} />
<Content content={props.entry.content} highlight={search} />
</Box>
{props.entry.enclosureType && props.entry.enclosureUrl && (
<Box pt="md">