Files
afriadirahman 8c6dad2a31
tests / ci (push) Canceled after 0s
Admin Panel
2026-09-29 14:57:37 +07:00

27 lines
772 B
TypeScript

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),
})),
};
}