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(" ")
|
2022-10-29 15:06:35 +02:00
|
|
|
return (
|
|
|
|
|
<Highlight
|
2024-01-01 10:10:05 +01:00
|
|
|
inherit
|
2022-10-29 15:06:35 +02:00
|
|
|
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
|
|
|
}
|