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