import Link from 'next/link' import { getPayload } from 'payload' import configPromise from '@payload-config' import { clearFrontendCache } from './admin-cache-actions' const QUICK_LINKS = [ { description: 'Manage hero modules, featured products, support panels, and homepage news surfaces.', href: '/admin/globals/homepage', title: 'Homepage', }, { description: 'Open core product records, templates, editor-driven pages, downloads, reviews, and videos.', href: '/admin/collections/products', title: 'Products', }, { description: 'Review firmware, manuals, online-upgrade entries, and release-note content.', href: '/admin/collections/downloads', title: 'Downloads', }, { description: 'Keep support landing copy, FAQ content, contact instructions, and warranty policy aligned.', href: '/admin/globals/supportPage', title: 'Support', }, { description: 'Track incoming after-sales, distributor, and OEM requests in one operations lane.', href: '/admin/collections/afterServiceRequests', title: 'Operations', }, { description: 'Publish news, maintain redirects, and keep site-wide branding settings consistent.', href: '/admin/collections/news', title: 'Publishing', }, ] as const const WORKSTREAMS = [ 'Template-backed products: keep local template assignments stable and manage hero/card media from the product record.', 'Editor-driven products: use the imported legacy HTML as the rebuild reference, then move final content into overview and structured fields.', 'Downloads: maintain release notes, package links, online-upgrade guidance, and product visibility together.', 'Social proof: attach videos and reviews directly to each product so the frontend tabs stay complete.', ] as const function formatCount(value: number) { return new Intl.NumberFormat('en-US').format(value) } async function getOverviewCounts() { const payload = await getPayload({ config: configPromise }) const [ products, downloads, productVideos, productReviews, news, faqs, dealers, afterServiceRequests, distributorRequests, oemRequests, ] = await Promise.all([ payload.count({ collection: 'products' }), payload.count({ collection: 'downloads' }), payload.count({ collection: 'productVideos' }), payload.count({ collection: 'productReviews' }), payload.count({ collection: 'news' }), payload.count({ collection: 'faqs' }), payload.count({ collection: 'dealers' }), payload.count({ collection: 'afterServiceRequests' }), payload.count({ collection: 'distributorRequests' }), payload.count({ collection: 'oemRequests' }), ]) return [ { eyebrow: 'Catalog', href: '/admin/collections/products', title: 'Products', value: products.totalDocs }, { eyebrow: 'Catalog', href: '/admin/collections/downloads', title: 'Downloads', value: downloads.totalDocs }, { eyebrow: 'Social Proof', href: '/admin/collections/productVideos', title: 'Product Videos', value: productVideos.totalDocs }, { eyebrow: 'Social Proof', href: '/admin/collections/productReviews', title: 'Product Reviews', value: productReviews.totalDocs }, { eyebrow: 'Publishing', href: '/admin/collections/news', title: 'News', value: news.totalDocs }, { eyebrow: 'Support', href: '/admin/collections/faqs', title: 'FAQs', value: faqs.totalDocs }, { eyebrow: 'Sales', href: '/admin/collections/dealers', title: 'Dealers', value: dealers.totalDocs }, { eyebrow: 'Operations', href: '/admin/collections/afterServiceRequests', title: 'Requests', value: afterServiceRequests.totalDocs + distributorRequests.totalDocs + oemRequests.totalDocs, }, ] } export async function AdminHome({ cacheCleared = false }: { cacheCleared?: boolean }) { const stats = await getOverviewCounts() return (

Eversolo Content Studio

A cleaner control room for products, publishing, and support.

This workspace keeps template-backed products, CMS-built pages, firmware updates, reviews, videos, and support operations in one place.

Open products Edit homepage
{cacheCleared ? (
Frontend cache cleared. Refresh the storefront to confirm the latest content, ordering, and homepage feeds.
) : null}
{stats.map((stat) => ( {stat.eyebrow} {formatCount(stat.value)} {stat.title} ))}

Priority lanes

Jump into the surfaces that drive the storefront most often.

{QUICK_LINKS.map((item) => ( {item.title} {item.description} ))}

Editorial guidance

Keep the admin team working the same way across templates, downloads, and support.

    {WORKSTREAMS.map((item) => (
  • {item}
  • ))}
) }