mirror of
https://github.com/ichsankurnia/hats-app.git
synced 2026-12-05 10:46:29 +00:00
aa99536a32
Use BASE_URL_API_LOCAL_SERVER for server-side data requests and load the layout session through the cached helper. Update production URLs to HTTPS and use 127.0.0.1 for local API endpoints.
131 lines
4.0 KiB
TypeScript
131 lines
4.0 KiB
TypeScript
import './globals.css'
|
|
import 'react-lazy-load-image-component/src/effects/blur.css';
|
|
|
|
import type { Metadata, Viewport } from 'next'
|
|
import { Plus_Jakarta_Sans } from 'next/font/google'
|
|
|
|
import { getCacheServerSession } from '@/lib/get-access-data'
|
|
|
|
import { ThemeProvider } from '@/providers/ThemeProvider'
|
|
import SessionProvider from '@/providers/SessionProvider'
|
|
import { Toaster } from '@/components/ui/sonner';
|
|
import AntdConfigProvider from '@/providers/AntdConfigProvider';
|
|
import ProgressBarProviders from '@/providers/ProgressBarProvider';
|
|
import { TooltipProvider } from '@/components/ui/tooltip';
|
|
import ServiceWorkerRegister from '@/components/pwa/ServiceWorkerRegister';
|
|
|
|
|
|
const jakarta = Plus_Jakarta_Sans({ subsets: ['latin'] })
|
|
|
|
export const metadata: Metadata = {
|
|
metadataBase: new URL(process.env.NEXT_PUBLIC_APP_URL || 'https://hats.hisnutech.my.id'),
|
|
title: 'HIS Attendance Task System (H.A.T.s)',
|
|
description: 'H.A.T.s HIS Attendance Task System (smart absence, task management, work permit and leave mangement, etc).',
|
|
applicationName: 'HIS Attendance Task System (H.A.T.s)',
|
|
keywords: ["react", "server components", 'rsc', 'nextjs', 'tailwind', 'typescript', 'shadcn', 'presence', 'absence', 'task', 'admin', 'cms', 'dashboard'],
|
|
authors: [{ name: 'ichsankurnia', url: 'https://ichsankurnia-portfolio.vercel.app' }],
|
|
creator: 'ichsankurnia',
|
|
manifest: '/manifest.webmanifest',
|
|
appleWebApp: {
|
|
capable: true,
|
|
statusBarStyle: 'default',
|
|
title: 'H.A.T.s',
|
|
},
|
|
icons: {
|
|
icon: [
|
|
{ url: '/assets/logo192.png', sizes: '192x192', type: 'image/png' },
|
|
{ url: '/assets/logo512.png', sizes: '512x512', type: 'image/png' },
|
|
],
|
|
apple: [
|
|
{ url: '/assets/apple-touch-icon.png', sizes: '180x180', type: 'image/png' },
|
|
],
|
|
},
|
|
formatDetection: {
|
|
telephone: false,
|
|
},
|
|
openGraph: {
|
|
title: "HIS Attendance Task System (H.A.T.s)",
|
|
description: "H.A.T.s HIS Attendance Task System (smart absence, task management, work permit and leave mangement, etc).",
|
|
images: [
|
|
{
|
|
url: '/assets/logo512.png',
|
|
width: 512,
|
|
height: 512,
|
|
alt: 'HIS Attendance Task System (H.A.T.s)',
|
|
},
|
|
],
|
|
},
|
|
twitter: {
|
|
title: "HIS Attendance Task System (H.A.T.s)",
|
|
description: "H.A.T.s HIS Attendance Task System (smart absence, task management, work permit and leave mangement, etc).",
|
|
images: ['/assets/logo512.png'],
|
|
},
|
|
pinterest: {
|
|
richPin: true
|
|
},
|
|
category: 'attendance',
|
|
robots: {
|
|
index: true,
|
|
follow: true,
|
|
nocache: false,
|
|
googleBot: {
|
|
index: true,
|
|
follow: true,
|
|
noimageindex: false,
|
|
'max-video-preview': -1,
|
|
'max-image-preview': 'large',
|
|
'max-snippet': -1,
|
|
},
|
|
},
|
|
}
|
|
|
|
export const viewport: Viewport = {
|
|
themeColor: [
|
|
{ media: '(prefers-color-scheme: light)', color: '#EA512C' },
|
|
{ media: '(prefers-color-scheme: dark)', color: '#EA512C' },
|
|
],
|
|
width: 'device-width',
|
|
initialScale: 1,
|
|
}
|
|
|
|
export default async function RootLayout({
|
|
children,
|
|
modal
|
|
}: {
|
|
children: React.ReactNode
|
|
modal: React.ReactNode;
|
|
}) {
|
|
// FOR INSECURE SSL (ex: Self Signed Certificates)
|
|
// process.env.NODE_TLS_REJECT_UNAUTHORIZED = '0'
|
|
|
|
const session = await getCacheServerSession()
|
|
|
|
return (
|
|
<html lang="en" suppressHydrationWarning>
|
|
<head>
|
|
<link rel="apple-touch-icon" href="/assets/apple-touch-icon.png" />
|
|
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/@tabler/icons-webfont@3.35.0/dist/tabler-icons.min.css" crossOrigin="anonymous" referrerPolicy="no-referrer"></link>
|
|
</head>
|
|
<body className={jakarta.className}>
|
|
<ServiceWorkerRegister />
|
|
<SessionProvider session={session} basePath={process.env.BASE_PATH}>
|
|
|
|
<ThemeProvider attribute="class" defaultTheme="system" enableSystem>
|
|
<AntdConfigProvider>
|
|
<ProgressBarProviders>
|
|
<TooltipProvider>
|
|
<div className='bg-soft dark:bg-zinc-950'>
|
|
{children}
|
|
{modal}
|
|
</div>
|
|
</TooltipProvider>
|
|
</ProgressBarProviders>
|
|
</AntdConfigProvider>
|
|
<Toaster richColors />
|
|
</ThemeProvider>
|
|
</SessionProvider>
|
|
</body>
|
|
</html>
|
|
)
|
|
}
|