"use client"; import { useEffect, useState, Suspense, lazy } from "react"; import { motion } from "framer-motion"; import StorefrontHeader from "@/components/storefront/StorefrontHeader"; import StorefrontFooter from "@/components/storefront/StorefrontFooter"; import { api } from "@/lib/api"; import { getBrandSettingsPublic } from "@/actions/brand-settings"; // Lazy load heavy sections const MissionSection = lazy(() => import("@/components/about/MissionSection")); const FamilyTimelineSection = lazy(() => import("@/components/about/FamilyTimelineSection")); const ContactSection = lazy(() => import("@/components/about/ContactSection")); const CTASection = lazy(() => import("@/components/about/CTASection")); // Use Next.js rewrite (next.config.ts) so the browser can stream assets // via same-origin /storage/* and avoid next/image "upstream resolved to // private ip" failures when the upstream is localhost MinIO. const OLATHE_SWEET_LOGO_DARK = "/storage/brand-logos/64294306-5f42-463d-a5e8-2ad6c81a96de/olathe-sweet-logo.png"; export default function TuxedoAboutPage() { const [logoUrl, setLogoUrl] = useState(null); const [logoUrlDark, setLogoUrlDark] = useState(null); const [olatheSweetLogoUrlDark, setOlatheSweetLogoUrlDark] = useState(null); const [aboutHeadline, setAboutHeadline] = useState(null); const [aboutSubheadline, setAboutSubheadline] = useState(null); const [showWholesaleLink, setShowWholesaleLink] = useState(true); const [isAdmin, setIsAdmin] = useState(false); const [customFooterText, setCustomFooterText] = useState(null); const [contactEmail, setContactEmail] = useState(null); const [contactPhone, setContactPhone] = useState(null); const [address, setAddress] = useState("59751 David Road, Olathe, CO 81425"); useEffect(() => { async function load() { const settingsResult = await getBrandSettingsPublic("tuxedo"); if (settingsResult.success && settingsResult.settings) { const s = settingsResult.settings; setLogoUrl(s.logo_url ?? null); setLogoUrlDark(s.logo_url_dark ?? null); setOlatheSweetLogoUrlDark(s.olathe_sweet_logo_url_dark ?? null); setAboutHeadline(s.about_headline ?? null); setAboutSubheadline(s.about_subheadline ?? null); setCustomFooterText(s.custom_footer_text ?? null); setContactEmail(s.email ?? null); setContactPhone(s.phone ?? null); setShowWholesaleLink(s.show_wholesale_link ?? true); if (s.brand_id) { const { data: ws } = await api .from("wholesale_settings") .select("invoice_business_address") .eq("brand_id", s.brand_id) .single(); if (ws?.invoice_business_address) setAddress(ws.invoice_business_address); } } try { const { getCurrentAdminUser } = await import("@/actions/admin-user"); setIsAdmin(!!await getCurrentAdminUser()); } catch { /* not logged in */ } } load(); }, []); return (
{/* Hero Section */}
{/* Decorative elements */}
{/* Pattern overlay */}
{/* Text content */}
Our Heritage {aboutHeadline ?? "Three Generations of Sweet Corn Excellence"} {aboutSubheadline ?? "Over 40 years of growing and shipping Olathe Sweet Sweet Corn from our family to yours."}
{/* Logo */}
Olathe Sweet
{/* Bottom transition */}
{/* Mission Section */} }> {/* Family Timeline */} }> {/* Contact Section */} }> {/* CTA Section */} }>
); } // Simple loading fallback - no more skeleton spinners function LoadingFallback({ bg }: { bg: string }) { return
; }