"use client"; import { use, useState } from "react"; import Link from "next/link"; import { ReportView } from "@/components/report-view"; import { useReport, useReportMarkdown } from "@/hooks/use-reports"; export default function ReportPage({ params }: { params: Promise<{ id: string }> }) { const { id } = use(params); const { data: report, isLoading } = useReport(id); const [showMarkdown, setShowMarkdown] = useState(false); const { data: markdown, isLoading: markdownLoading } = useReportMarkdown( showMarkdown ? id : undefined, ); if (isLoading) { return
Loading…
; } if (!report) { returnReport not found.
; } return (Loading…
) : (
{markdown}
)}