Add three new frontend page sections: - Industrial parks (khu-cong-nghiep): listing, detail, filter bar - Transfer listings (chuyen-nhuong): search, category tabs, detail - AI reports dashboard: list, create, viewer with TOC Includes components, API clients, hooks, server helpers, i18n keys, navigation links in public and dashboard layouts, and lint fixes. Co-Authored-By: Paperclip <noreply@paperclip.ing>
16 lines
496 B
TypeScript
16 lines
496 B
TypeScript
import type { IndustrialParkDetail } from './khu-cong-nghiep-api';
|
|
|
|
const API_URL = process.env['NEXT_PUBLIC_API_URL'] ?? 'http://localhost:3001/api/v1';
|
|
|
|
export async function fetchIndustrialParkBySlug(slug: string): Promise<IndustrialParkDetail | null> {
|
|
try {
|
|
const res = await fetch(`${API_URL}/industrial/parks/${slug}`, {
|
|
next: { revalidate: 300 },
|
|
});
|
|
if (!res.ok) return null;
|
|
return res.json() as Promise<IndustrialParkDetail>;
|
|
} catch {
|
|
return null;
|
|
}
|
|
}
|