feat: add industry demo gallery and isolated site presentation

This commit is contained in:
2026-11-03 22:34:01 +08:00
parent d5c0aa7562
commit f88f5e7786
6 changed files with 159 additions and 2 deletions
+31
View File
@@ -0,0 +1,31 @@
import { fetchAPI } from "./api-client";
import type { StreamFieldBlock } from "@/types/wagtail";
export interface IndustryDemo {
slug: string;
label: string;
company: string;
description: string;
url: string;
}
export interface DemoPage {
industry: string;
label: string;
company: string;
title: string;
blocks: StreamFieldBlock[];
html: string;
intro: string;
children: { title: string; url: string }[];
navigation: { title: string; url: string }[];
}
export function getIndustryDemos() {
return fetchAPI<{ items: IndustryDemo[] }>("/api/v1/custom/core/demos/", { revalidate: 0 });
}
export function getDemoPage(industry: string, segments: string[] = []) {
const path = encodeURIComponent(segments.join("/"));
return fetchAPI<DemoPage>(`/api/v1/custom/core/demos/${encodeURIComponent(industry)}/?path=${path}`, { revalidate: 0 });
}