{branding.name}
Find, book & manage your appointments with ease.
import { Scissors } from "lucide-react"; import Link from "next/link"; import { redirect } from "next/navigation"; import { auth } from "@/auth"; import { Button } from "@/components/ui/button"; import { getBranding } from "@/lib/business/branding"; import { getPrimaryBusiness } from "@/lib/business/get-primary-business"; import { hasPermission, isSuperAdmin } from "@/lib/auth/permissions"; import { Permission } from "@/generated/prisma/enums"; import { prisma } from "@/lib/db/prisma"; import { WelcomeInstallCard } from "@/features/pwa/components/welcome-install-card"; /** The normal business welcome screen. Kept outside the root entry point so * Manager mode can redirect without evaluating business-only imports. */ export default async function BusinessWelcomePage() { const session = await auth(); if (session?.user) { const staffProfile = await prisma.staffProfile.findUnique({ where: { userId: session.user.id } }); if (staffProfile) { const canManageStaff = await hasPermission(session.user.id, Permission.MANAGE_STAFF); redirect(canManageStaff ? "/owner" : "/staff"); } if (await isSuperAdmin(session.user.id)) redirect("/owner/calendar"); redirect("/home"); } const [branding, business] = await Promise.all([getBranding(), getPrimaryBusiness()]); const guestBookingEnabled = business.bookingRule?.allowGuestBooking ?? false; const heroImageMobileUrl = branding.welcomeBackgroundMobileUrl ?? branding.welcomeBackgroundDesktopUrl ?? branding.coverImageUrl; const heroImageDesktopUrl = branding.welcomeBackgroundDesktopUrl ?? branding.welcomeBackgroundMobileUrl ?? branding.coverImageUrl; const hasHeroImage = !!(heroImageMobileUrl || heroImageDesktopUrl); return (
Find, book & manage your appointments with ease.