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

23 lines
609 B
TypeScript
Raw Normal View History

import { Highlight } from "@mantine/core"
2025-06-27 16:29:31 +02:00
import { useAppSelector } from "@/app/store"
import type { Entry } from "@/app/types"
export interface FeedEntryTitleProps {
entry: Entry
}
2025-07-29 15:21:15 +02:00
export function FeedEntryTitle(props: Readonly<FeedEntryTitleProps>) {
const search = useAppSelector(state => state.entries.search)
const keywords = search?.split(" ")
return (
<Highlight
inherit
highlight={keywords ?? ""}
// make sure ellipsis is shown when title is too long
span
>
{props.entry.title}
</Highlight>
)
}