Admin Panel
tests / ci (push) Canceled after 0s

This commit is contained in:
2026-09-29 14:57:37 +07:00
parent 04fbddba13
commit 8c6dad2a31
94 changed files with 4864 additions and 1151 deletions
+10
View File
@@ -0,0 +1,10 @@
import { usePage } from '@inertiajs/react';
import { portfolio } from '@/data/projects';
import type { Project } from '@/types';
/** Portfolio helpers for pages that receive a `projects` prop. */
export function usePortfolio() {
const { projects } = usePage<{ projects: Project[] }>().props;
return portfolio(projects ?? []);
}
+26
View File
@@ -0,0 +1,26 @@
import { usePage } from '@inertiajs/react';
import { telHref, whatsappHref } from '@/data/site';
/**
* Editable company contact details and office locations (admin panel →
* Info Perusahaan), with ready-to-use link targets.
*/
export function useSiteInfo() {
const { contact, offices } = usePage().props.site;
return {
phone: { label: contact.phone, href: telHref(contact.phone) },
whatsapp: {
label: contact.whatsapp,
href: whatsappHref(contact.whatsapp),
},
email: {
busdev: contact.email_busdev,
support: contact.email_support,
},
offices: offices.map((office) => ({
...office,
phoneHref: telHref(office.phone),
})),
};
}