manufacturers: public directory with 1,142 NAB 2026 exhibitors
New public routes: /manufacturers - searchable index, filter by show + first letter /manufacturers/[slug] - profile page with bio, categories, trade shows, news, JSON-LD Data sourced from bb.tracked_companies + bb.trade_show_exhibitors, seeded from the NAB Show 2026 Map Your Show exhibitor list. Adds schema extensions on bb.tracked_companies (slug, logo_url, bio, contact, social handles, press_url, ad_status, exhibits_nab/ibc) and bb.press_releases (manufacturer_id FK, source_url, published_at, status). Each profile page emits Organization JSON-LD for SEO + canonical URL. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
298
src/app/manufacturers/[slug]/page.tsx
Normal file
298
src/app/manufacturers/[slug]/page.tsx
Normal file
@@ -0,0 +1,298 @@
|
||||
import type { Metadata } from "next";
|
||||
import { notFound } from "next/navigation";
|
||||
import Link from "next/link";
|
||||
import Header from "@/components/Header";
|
||||
import Footer from "@/components/Footer";
|
||||
import { createClient } from "@/lib/supabase/server";
|
||||
|
||||
export const revalidate = 1800;
|
||||
|
||||
type Params = { slug: string };
|
||||
|
||||
async function loadManufacturer(slug: string) {
|
||||
const supabase = await createClient();
|
||||
const { data } = await supabase
|
||||
.from("tracked_companies")
|
||||
.select(
|
||||
"id, slug, company_name, bio, bio_source, logo_url, company_website, contact_email, contact_url, hq_city, hq_country, linkedin_url, twitter_handle, youtube_url, press_url, categories, exhibits_nab, exhibits_ibc, mention_count, last_mentioned, featured, ad_status"
|
||||
)
|
||||
.eq("slug", slug)
|
||||
.eq("directory_visible", true)
|
||||
.maybeSingle();
|
||||
if (!data) return null;
|
||||
|
||||
// Per-show appearances
|
||||
const { data: shows } = await supabase
|
||||
.from("trade_show_exhibitors")
|
||||
.select("show, show_year, booth, description, url, website")
|
||||
.eq("exhibitor_name", data.company_name)
|
||||
.order("show_year", { ascending: false });
|
||||
|
||||
// Recent BB stories that mention this company (mention_count guides interest)
|
||||
const { data: pressReleases } = await supabase
|
||||
.from("press_releases")
|
||||
.select("title, slug, published_at, source_url")
|
||||
.eq("manufacturer_id", data.id)
|
||||
.order("published_at", { ascending: false })
|
||||
.limit(10);
|
||||
|
||||
return { company: data, shows: shows || [], pressReleases: pressReleases || [] };
|
||||
}
|
||||
|
||||
export async function generateMetadata({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<Params>;
|
||||
}): Promise<Metadata> {
|
||||
const { slug } = await params;
|
||||
const result = await loadManufacturer(slug);
|
||||
if (!result) {
|
||||
return { title: "Manufacturer not found — Broadcast Beat" };
|
||||
}
|
||||
const { company } = result;
|
||||
const title = `${company.company_name} — Manufacturer Profile | Broadcast Beat`;
|
||||
const description =
|
||||
(company.bio || "").slice(0, 200) ||
|
||||
`${company.company_name} is a broadcast industry manufacturer covered by Broadcast Beat.`;
|
||||
return {
|
||||
title,
|
||||
description,
|
||||
alternates: { canonical: `/manufacturers/${slug}` },
|
||||
openGraph: {
|
||||
title,
|
||||
description,
|
||||
url: `https://broadcastbeat.com/manufacturers/${slug}`,
|
||||
type: "profile",
|
||||
...(company.logo_url ? { images: [{ url: company.logo_url }] } : {}),
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
export default async function ManufacturerProfile({
|
||||
params,
|
||||
}: {
|
||||
params: Promise<Params>;
|
||||
}) {
|
||||
const { slug } = await params;
|
||||
const result = await loadManufacturer(slug);
|
||||
if (!result) notFound();
|
||||
const { company, shows, pressReleases } = result;
|
||||
|
||||
const jsonLd = {
|
||||
"@context": "https://schema.org",
|
||||
"@type": "Organization",
|
||||
name: company.company_name,
|
||||
description: company.bio || undefined,
|
||||
url: company.company_website || undefined,
|
||||
logo: company.logo_url || undefined,
|
||||
sameAs: [
|
||||
company.linkedin_url,
|
||||
company.twitter_handle ? `https://twitter.com/${company.twitter_handle}` : null,
|
||||
company.youtube_url,
|
||||
].filter(Boolean),
|
||||
address:
|
||||
company.hq_city || company.hq_country
|
||||
? {
|
||||
"@type": "PostalAddress",
|
||||
addressLocality: company.hq_city || undefined,
|
||||
addressCountry: company.hq_country || undefined,
|
||||
}
|
||||
: undefined,
|
||||
};
|
||||
|
||||
return (
|
||||
<div className="min-h-screen bg-white">
|
||||
<Header />
|
||||
<script
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(jsonLd) }}
|
||||
/>
|
||||
<article className="max-w-4xl mx-auto px-4 py-10">
|
||||
<nav className="text-xs text-ink/55 mb-6">
|
||||
<Link href="/manufacturers" className="hover:text-brand-primary">
|
||||
← Manufacturer Directory
|
||||
</Link>
|
||||
</nav>
|
||||
|
||||
<header className="flex flex-col sm:flex-row gap-6 mb-8 pb-8 border-b border-ink/10">
|
||||
<div className="w-24 h-24 rounded-xl bg-ink/5 flex items-center justify-center overflow-hidden flex-shrink-0">
|
||||
{company.logo_url ? (
|
||||
/* eslint-disable-next-line @next/next/no-img-element */
|
||||
<img
|
||||
src={company.logo_url}
|
||||
alt={`${company.company_name} logo`}
|
||||
className="w-full h-full object-contain"
|
||||
/>
|
||||
) : (
|
||||
<span className="text-ink/40 text-3xl font-bold">
|
||||
{(company.company_name || "?").trim().charAt(0).toUpperCase()}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="min-w-0 flex-1">
|
||||
<h1 className="text-3xl md:text-4xl font-display font-bold text-ink mb-1">
|
||||
{company.company_name}
|
||||
</h1>
|
||||
<div className="flex items-center gap-2 flex-wrap text-xs">
|
||||
{company.exhibits_nab && (
|
||||
<span className="bg-amber-50 text-amber-700 px-2 py-0.5 rounded font-semibold uppercase tracking-wider">
|
||||
NAB Show 2026
|
||||
</span>
|
||||
)}
|
||||
{company.exhibits_ibc && (
|
||||
<span className="bg-blue-50 text-blue-700 px-2 py-0.5 rounded font-semibold uppercase tracking-wider">
|
||||
IBC
|
||||
</span>
|
||||
)}
|
||||
{(company.hq_city || company.hq_country) && (
|
||||
<span className="text-ink/60">
|
||||
{[company.hq_city, company.hq_country].filter(Boolean).join(", ")}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
<div className="mt-3 flex flex-wrap gap-3 text-sm">
|
||||
{company.company_website && (
|
||||
<a
|
||||
href={company.company_website}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-brand-primary hover:underline"
|
||||
>
|
||||
Website ↗
|
||||
</a>
|
||||
)}
|
||||
{company.press_url && (
|
||||
<a
|
||||
href={company.press_url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-brand-primary hover:underline"
|
||||
>
|
||||
Newsroom ↗
|
||||
</a>
|
||||
)}
|
||||
{company.contact_url && (
|
||||
<a
|
||||
href={company.contact_url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-brand-primary hover:underline"
|
||||
>
|
||||
Contact ↗
|
||||
</a>
|
||||
)}
|
||||
{company.linkedin_url && (
|
||||
<a
|
||||
href={company.linkedin_url}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-ink/60 hover:text-brand-primary"
|
||||
>
|
||||
LinkedIn
|
||||
</a>
|
||||
)}
|
||||
{company.twitter_handle && (
|
||||
<a
|
||||
href={`https://twitter.com/${company.twitter_handle}`}
|
||||
target="_blank"
|
||||
rel="noopener noreferrer"
|
||||
className="text-ink/60 hover:text-brand-primary"
|
||||
>
|
||||
X / Twitter
|
||||
</a>
|
||||
)}
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
|
||||
{company.bio && (
|
||||
<section className="mb-10">
|
||||
<h2 className="text-lg font-display font-bold text-ink mb-2">About</h2>
|
||||
<p className="text-ink/80 leading-relaxed">{company.bio}</p>
|
||||
{company.bio_source && (
|
||||
<p className="text-xs text-ink/40 mt-2">
|
||||
Source: {company.bio_source}
|
||||
</p>
|
||||
)}
|
||||
</section>
|
||||
)}
|
||||
|
||||
{company.categories && company.categories.length > 0 && (
|
||||
<section className="mb-10">
|
||||
<h2 className="text-lg font-display font-bold text-ink mb-2">Categories</h2>
|
||||
<div className="flex flex-wrap gap-2">
|
||||
{company.categories.map((c: string) => (
|
||||
<span
|
||||
key={c}
|
||||
className="text-xs bg-ink/5 text-ink/70 px-2.5 py-1 rounded-full"
|
||||
>
|
||||
{c}
|
||||
</span>
|
||||
))}
|
||||
</div>
|
||||
</section>
|
||||
)}
|
||||
|
||||
{shows.length > 0 && (
|
||||
<section className="mb-10">
|
||||
<h2 className="text-lg font-display font-bold text-ink mb-3">
|
||||
Trade-show appearances
|
||||
</h2>
|
||||
<ul className="space-y-2">
|
||||
{shows.map((s) => (
|
||||
<li
|
||||
key={`${s.show}-${s.show_year}-${s.booth || "?"}`}
|
||||
className="bg-surface-soft border border-ink/10 rounded-md px-4 py-3 flex items-center justify-between gap-4"
|
||||
>
|
||||
<div className="min-w-0">
|
||||
<span className="font-semibold text-ink">
|
||||
{s.show} {s.show_year}
|
||||
</span>
|
||||
{s.booth && (
|
||||
<span className="ml-3 text-sm text-ink/60">Booth {s.booth}</span>
|
||||
)}
|
||||
</div>
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
)}
|
||||
|
||||
{pressReleases.length > 0 && (
|
||||
<section className="mb-10">
|
||||
<h2 className="text-lg font-display font-bold text-ink mb-3">Recent news</h2>
|
||||
<ul className="space-y-2">
|
||||
{pressReleases.map((p) => (
|
||||
<li key={p.slug || p.source_url} className="text-sm">
|
||||
{p.slug ? (
|
||||
<Link
|
||||
href={`/news/${p.slug}`}
|
||||
className="text-brand-primary hover:underline"
|
||||
>
|
||||
{p.title}
|
||||
</Link>
|
||||
) : (
|
||||
<span>{p.title}</span>
|
||||
)}
|
||||
{p.published_at && (
|
||||
<span className="text-ink/50 text-xs ml-2">
|
||||
{new Date(p.published_at).toISOString().slice(0, 10)}
|
||||
</span>
|
||||
)}
|
||||
</li>
|
||||
))}
|
||||
</ul>
|
||||
</section>
|
||||
)}
|
||||
|
||||
<footer className="text-xs text-ink/40 mt-12 pt-6 border-t border-ink/10">
|
||||
Listing maintained by Broadcast Beat editorial.
|
||||
{company.last_mentioned && (
|
||||
<> Last mentioned in coverage on {new Date(company.last_mentioned).toISOString().slice(0, 10)}.</>
|
||||
)}
|
||||
</footer>
|
||||
</article>
|
||||
<Footer />
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user