point the resource to the nextjs server for maintenance screen

This commit is contained in:
Pallavi Kumari
2025-11-06 20:27:24 +05:30
committed by Owen Schwartz
parent 1d862131dd
commit d82535d3e1
6 changed files with 86 additions and 224 deletions

View File

@@ -0,0 +1,53 @@
import { headers } from 'next/headers';
import { db } from '@server/db';
import { resources } from '@server/db';
import { eq } from 'drizzle-orm';
export default async function MaintenanceScreen() {
const headersList = await headers();
const host = headersList.get('host') || '';
const hostname = host.split(':')[0];
const [resource] = await db
.select()
.from(resources)
.where(eq(resources.fullDomain, hostname))
.limit(1);
const title = resource?.maintenanceTitle || 'Service Temporarily Unavailable';
const message = resource?.maintenanceMessage || 'We are currently experiencing technical difficulties. Please check back soon.';
const estimatedTime = resource?.maintenanceEstimatedTime;
return (
<div className="min-h-screen flex items-center justify-center bg-gray-100">
<div className="max-w-2xl w-full bg-white/10 backdrop-blur-lg rounded-3xl p-8 shadow-2xl border border-white/20">
<div className="text-center">
<div className="text-6xl mb-6 animate-pulse">
🔧
</div>
<h1 className="text-4xl font-bold text-black mb-4">
{title}
</h1>
<p className="text-xl text-black/90 mb-6">
{message}
</p>
{estimatedTime && (
<div className="mt-8 p-4 bg-white/15 rounded-xl">
<p className="text-black font-semibold">
Estimated completion:
</p>
<p className="text-black/90 mt-2">
{estimatedTime}
</p>
</div>
)}
</div>
</div>
</div>
);
}