feat: add industry demo gallery and isolated site presentation
This commit is contained in:
@@ -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 });
|
||||
}
|
||||
Reference in New Issue
Block a user