2026-07-22 19:35:04 +02:00
|
|
|
"use client";
|
|
|
|
|
|
|
|
|
|
import { useSetAtom } from "jotai";
|
|
|
|
|
import { Database } from "lucide-react";
|
|
|
|
|
import type { FC } from "react";
|
|
|
|
|
import { openRunCitationPanelAtom } from "@/atoms/citation/citation-panel.atom";
|
|
|
|
|
import { Button } from "@/components/ui/button";
|
|
|
|
|
import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip";
|
|
|
|
|
|
|
|
|
|
/** Inline citation badge for a scraper run; opens the run in the citation panel. */
|
|
|
|
|
export const RunCitation: FC<{ runId: string }> = ({ runId }) => {
|
|
|
|
|
const openRunPanel = useSetAtom(openRunCitationPanelAtom);
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<Tooltip>
|
|
|
|
|
<TooltipTrigger asChild>
|
|
|
|
|
<Button
|
|
|
|
|
type="button"
|
|
|
|
|
variant="ghost"
|
|
|
|
|
onClick={() => openRunPanel({ runId })}
|
|
|
|
|
className="ml-0.5 inline-flex h-5 min-w-5 items-center justify-center gap-0.5 rounded-md bg-popover px-1.5 text-[11px] font-medium text-popover-foreground/80 align-baseline"
|
2026-07-22 21:01:05 +02:00
|
|
|
aria-label="See where this came from"
|
2026-07-22 19:35:04 +02:00
|
|
|
>
|
|
|
|
|
<Database className="size-3" />
|
2026-07-22 21:01:05 +02:00
|
|
|
Source
|
2026-07-22 19:35:04 +02:00
|
|
|
</Button>
|
|
|
|
|
</TooltipTrigger>
|
2026-07-22 21:01:05 +02:00
|
|
|
<TooltipContent>See where this came from</TooltipContent>
|
2026-07-22 19:35:04 +02:00
|
|
|
</Tooltip>
|
|
|
|
|
);
|
|
|
|
|
};
|