77 lines
2.6 KiB
TypeScript
77 lines
2.6 KiB
TypeScript
import type { Metadata } from "next";
|
|
import "./globals.css";
|
|
import type { Viewport } from "next";
|
|
import crypto from "crypto";
|
|
import { OmniSyncProvider } from "../components/OmniSyncProvider";
|
|
|
|
export const viewport: Viewport = {
|
|
themeColor: "#0b141a",
|
|
};
|
|
|
|
export const metadata: Metadata = {
|
|
title: "JUMPA.ID | Enterprise Real-Time Chat",
|
|
description: "Secure WhatsApp-Native Chat Platform",
|
|
manifest: "/manifest.json",
|
|
appleWebApp: {
|
|
capable: true,
|
|
statusBarStyle: "black-translucent",
|
|
title: "JUMPA Chat",
|
|
},
|
|
};
|
|
|
|
export default async function RootLayout({
|
|
children,
|
|
}: {
|
|
children: React.ReactNode;
|
|
}) {
|
|
|
|
// TSM Versioning Format: [TSM.ID].hh.mm.ss.DD.MM.YYYY.XXXX
|
|
const date = new Date();
|
|
const format2 = (n: number) => n.toString().padStart(2, '0');
|
|
const hh = format2(date.getUTCHours());
|
|
const mm = format2(date.getUTCMinutes());
|
|
const ss = format2(date.getUTCSeconds());
|
|
const DD = format2(date.getUTCDate());
|
|
const MM = format2(date.getUTCMonth() + 1);
|
|
const YYYY = date.getUTCFullYear();
|
|
const XXXX = crypto.randomBytes(2).toString('hex').toUpperCase();
|
|
const tsmVersion = `[TSM.ID].${hh}.${mm}.${ss}.${DD}.${MM}.${YYYY}.${XXXX}`;
|
|
|
|
return (
|
|
<html lang="id" data-theme="dark">
|
|
<head>
|
|
<link rel="manifest" href="/manifest.json" />
|
|
<link rel="apple-touch-icon" href="/icon512_maskable.png" />
|
|
<script dangerouslySetInnerHTML={{__html: `
|
|
// PKX NUCLEAR CACHE BUSTER: Unregister all Service Workers & clear all caches
|
|
if ('serviceWorker' in navigator) {
|
|
navigator.serviceWorker.getRegistrations().then(function(registrations) {
|
|
for (var i = 0; i < registrations.length; i++) {
|
|
registrations[i].unregister();
|
|
}
|
|
});
|
|
}
|
|
if ('caches' in window) {
|
|
caches.keys().then(function(names) {
|
|
for (var i = 0; i < names.length; i++) {
|
|
caches.delete(names[i]);
|
|
}
|
|
});
|
|
}
|
|
`}} />
|
|
</head>
|
|
<body className="antialiased font-sans transition-colors duration-500">
|
|
<OmniSyncProvider initialLocale="id">
|
|
{children}
|
|
{/* TSM PERMANENT WATERMARK */}
|
|
<div className="fixed bottom-1 right-1 z-[9999] opacity-30 pointer-events-none select-none">
|
|
<span className="text-[8px] font-mono text-white tracking-widest drop-shadow-[0_0_5px_rgba(255,255,255,0.8)]">
|
|
{tsmVersion}
|
|
</span>
|
|
</div>
|
|
</OmniSyncProvider>
|
|
</body>
|
|
</html>
|
|
);
|
|
}
|