Files
project-fileshare/apps/frontend/src/app/layout.tsx

83 lines
3.1 KiB
TypeScript
Raw Normal View History

2026-10-29 13:21:30 +06:00
import type { Metadata } from 'next';
import './globals.css';
import { AuthProvider } from '@/context/auth-context';
import { HydrationGuard } from '@/components/common/HydrationGuard';
export const metadata: Metadata = {
title: 'Ecohub - Secure Video & File Sharing Management System',
description: 'Enterprise-grade secure video streaming, file management, and administrator-controlled sharing platform by Ecohub',
icons: {
icon: '/logo.png',
apple: '/logo.png',
},
};
export default function RootLayout({
children,
}: {
children: React.ReactNode;
}) {
return (
<html lang="en" suppressHydrationWarning>
<head>
<script
dangerouslySetInnerHTML={{
__html: `
(function() {
// Intercept extension hydration error noise before Next.js error overlay hooks console
var origError = window.console.error;
window.console.error = function() {
var str = Array.prototype.slice.call(arguments).map(function(arg) {
return typeof arg === 'string' ? arg : (arg && arg.message) || '';
}).join(' ');
if (
str.indexOf('bis_skin_checked') !== -1 ||
str.indexOf('bis_register') !== -1 ||
str.indexOf('cz-shortcut-listen') !== -1 ||
str.indexOf('data-gr-ext-installed') !== -1
) {
return;
}
return origError.apply(window.console, arguments);
};
// Real-time DOM attribute cleaner
try {
var clean = function() {
var els = document.querySelectorAll('[bis_skin_checked], [bis_register]');
for (var i = 0; i < els.length; i++) {
els[i].removeAttribute('bis_skin_checked');
els[i].removeAttribute('bis_register');
}
};
var obs = new MutationObserver(function(mutations) {
for (var i = 0; i < mutations.length; i++) {
var m = mutations[i];
if (m.type === 'attributes' && m.attributeName && m.attributeName.indexOf('bis_') === 0) {
m.target.removeAttribute(m.attributeName);
}
}
});
if (document.documentElement) {
obs.observe(document.documentElement, {
attributes: true,
subtree: true,
attributeFilter: ['bis_skin_checked', 'bis_register']
});
clean();
}
} catch(e) {}
})();
`,
}}
/>
</head>
<body suppressHydrationWarning className="min-h-screen bg-[#f8fafc] text-slate-900 antialiased selection:bg-emerald-500/20 selection:text-emerald-800">
<HydrationGuard />
<AuthProvider>{children}</AuthProvider>
</body>
</html>
);
}