Files
commafeed/commafeed-client/src/components/content/FeedEntryTitle.tsx

23 lines
617 B
TypeScript
Raw Normal View History

2022-10-27 16:25:32 +02:00
import { Highlight } from "@mantine/core"
import { useAppSelector } from "app/store"
2023-12-28 19:54:51 +01:00
import { type Entry } from "app/types"
2022-10-27 16:25:32 +02:00
export interface FeedEntryTitleProps {
entry: Entry
}
export function FeedEntryTitle(props: FeedEntryTitleProps) {
const search = useAppSelector(state => state.entries.search)
const keywords = search?.split(" ")
return (
<Highlight
2024-01-01 10:10:05 +01:00
inherit
highlight={keywords ?? ""}
// make sure ellipsis is shown when title is too long
span
>
{props.entry.title}
</Highlight>
)
2022-10-27 16:25:32 +02:00
}