Summary card links to the detailed analysis tab
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_012vLHzh5qUhFtmJhzkcTbXL
This commit is contained in:
@@ -7,6 +7,7 @@ import type { Analysis } from "@/lib/types";
|
||||
|
||||
import { AnalysisLoading } from "./AnalysisLoading";
|
||||
import { Rich } from "./Rich";
|
||||
import { openTab } from "./Tabs";
|
||||
|
||||
const POLL_MS = 3000;
|
||||
const MAX_POLLS = 60;
|
||||
@@ -16,7 +17,16 @@ const MAX_POLLS = 60;
|
||||
* saved; this asks for it (queueing it again if it failed) and polls until the
|
||||
* worker has written it.
|
||||
*/
|
||||
export function ChartSummary({ chartId, initial }: { chartId: string; initial: Analysis | null }) {
|
||||
export function ChartSummary({
|
||||
chartId,
|
||||
initial,
|
||||
detailedDone = false,
|
||||
}: {
|
||||
chartId: string;
|
||||
initial: Analysis | null;
|
||||
/** The detailed analysis is ready: the link says so instead of offering it. */
|
||||
detailedDone?: boolean;
|
||||
}) {
|
||||
const [summary, setSummary] = useState<Analysis | null>(initial);
|
||||
const [gaveUp, setGaveUp] = useState(false);
|
||||
const done = summary?.status === "done";
|
||||
@@ -57,6 +67,17 @@ export function ChartSummary({ chartId, initial }: { chartId: string; initial: A
|
||||
<p className="summary-text">
|
||||
<Rich text={content.summary ?? ""} />
|
||||
</p>
|
||||
<a
|
||||
href="#elemzes"
|
||||
className="summary-more"
|
||||
onClick={(e) => {
|
||||
e.preventDefault();
|
||||
openTab("elemzes");
|
||||
}}
|
||||
>
|
||||
{detailedDone ? "Elolvasom a részletes elemzést" : "Kérj részletes elemzést: hat fejezet a képletedről"}
|
||||
<span aria-hidden="true"> →</span>
|
||||
</a>
|
||||
</>
|
||||
) : (
|
||||
<>
|
||||
|
||||
Reference in New Issue
Block a user