import { notFound } from "next/navigation"; import { api } from "~/trpc/server"; import { Card, CardContent, CardHeader, CardTitle } from "~/components/ui/card"; import { Button } from "~/components/ui/button"; import { Badge } from "~/components/ui/badge"; import { PageHeader } from "~/components/layout/page-header"; import { Separator } from "~/components/ui/separator"; import Link from "next/link"; import { Edit, Mail, Phone, MapPin, Building, Calendar, DollarSign, Globe, Hash, ArrowLeft, } from "lucide-react"; interface BusinessDetailPageProps { params: Promise<{ id: string }>; } export default async function BusinessDetailPage({ params, }: BusinessDetailPageProps) { const { id } = await params; const business = await api.businesses.getById({ id }); if (!business) { notFound(); } const formatDate = (date: Date) => { return new Intl.DateTimeFormat("en-US", { year: "numeric", month: "long", day: "numeric", }).format(date); }; return (
{business.email}
Phone
{business.phone}
Website
{business.website}Tax ID
{business.taxId}
{business.addressLine1}
)} {business.addressLine2 && ({business.addressLine2}
)} {(business.city ?? business.state ?? business.postalCode) && ({[ business.city, business.state, business.postalCode, ] .filter(Boolean) .join(", ")}
)} {business.country && ({business.country}
)}Business Added
{formatDate(business.createdAt)}
Nickname
{business.nickname}
Status
This business profile is used for generating invoices and represents your company information to clients.
{business.isDefault && (This is your default business and will be automatically selected when creating new invoices.
)}