diff --git a/yaba-web/src/components/bookmarks/bookmark.jsx b/yaba-web/src/components/bookmarks/bookmark.jsx index cc3c09d..af392d9 100644 --- a/yaba-web/src/components/bookmarks/bookmark.jsx +++ b/yaba-web/src/components/bookmarks/bookmark.jsx @@ -1,24 +1,28 @@ import React from "react"; import { Row, Col, Form, Button } from "../external"; import DateTimeHelper from "../../utils/dateTimeHelper"; -import "../../styles/component/bookmark.css"; +import { getHighlightedText } from "../../utils"; import { useNavigate } from "react-router-dom"; import { Tag } from "../../components"; export function Bookmark(props) { const navigate = useNavigate(); + const getTruncatedDescription = () => `${props.bookmark.description.substring(0, 97)}${props.bookmark.description.length >= 97 ? "..." : ""}`; + const getHighlightedTitle = () => getHighlightedText(props.bookmark.title, props.searchString); + const getHighlightedDescription = () => getHighlightedText(getTruncatedDescription(), props.searchString) + return