Compare commits
2 Commits
b079aec0be
...
d03f3fe9c9
| Author | SHA1 | Date |
|---|---|---|
|
|
d03f3fe9c9 | |
|
|
4633560140 |
|
|
@ -38,6 +38,15 @@ export function useReport(id: string | undefined): UseReportResult {
|
|||
const location = useLocation();
|
||||
|
||||
useEffect(() => {
|
||||
// Source 0: Demo mode — ALWAYS takes priority over any other source
|
||||
if (id === 'view-clinic') {
|
||||
setData(mockReport);
|
||||
setIsEnriched(true);
|
||||
setSocialHandles({ instagram: '@viewplastic', youtube: '@ViewclinicKR', facebook: 'viewps1' });
|
||||
setIsLoading(false);
|
||||
return;
|
||||
}
|
||||
|
||||
const state = location.state as LocationState | undefined;
|
||||
|
||||
// Source 1: Report data passed via navigation state (from AnalysisLoadingPage)
|
||||
|
|
@ -68,16 +77,7 @@ export function useReport(id: string | undefined): UseReportResult {
|
|||
return;
|
||||
}
|
||||
|
||||
// Source 2: Demo mode — return hardcoded mock data for sales prototype
|
||||
if (id === 'view-clinic') {
|
||||
setData(mockReport);
|
||||
setIsEnriched(true);
|
||||
setSocialHandles({ instagram: '@viewplastic', youtube: '@ViewclinicKR', facebook: 'viewps1' });
|
||||
setIsLoading(false);
|
||||
return;
|
||||
}
|
||||
|
||||
// Source 3: Fetch from Supabase by report ID (bookmarked/shared link)
|
||||
// Source 2: Fetch from Supabase by report ID (bookmarked/shared link)
|
||||
if (id) {
|
||||
fetchReportById(id)
|
||||
.then((row) => {
|
||||
|
|
|
|||
Loading…
Reference in New Issue