add button in the header to open entry link (#1333)

This commit is contained in:
Athou
2024-04-05 13:34:56 +02:00
parent d0b92774bc
commit 3097272179
5 changed files with 50 additions and 10 deletions

View File

@@ -0,0 +1,22 @@
import { Highlight } from "@mantine/core"
import { useAppSelector } from "app/store"
import { type Entry } from "app/types"
export interface FeedEntryTitleProps {
entry: Entry
}
export function FeedEntryTitle(props: 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>
)
}