import { Fragment } from "react"; import { Collapsible, CollapsibleContent, CollapsibleTrigger, } from "@/components/ui/collapsible"; import { useTranslation } from "@/lib/i18n/client"; import { Separator } from "@radix-ui/react-dropdown-menu"; import { useQuery } from "@tanstack/react-query"; import { ChevronsDownUp } from "lucide-react"; import { useTRPC } from "@karakeep/shared-react/trpc"; import HighlightCard from "../highlights/HighlightCard"; export default function HighlightsBox({ bookmarkId, readOnly, }: { bookmarkId: string; readOnly: boolean; }) { const api = useTRPC(); const { t } = useTranslation(); const { data: highlights, isPending: isLoading } = useQuery( api.highlights.getForBookmark.queryOptions({ bookmarkId }), ); if (isLoading || !highlights || highlights?.highlights.length === 0) { return null; } return ( {t("common.highlights")} {highlights.highlights.map((highlight) => ( ))} ); }