'use client'; import Link from 'next/link'; import type { Book } from '@ebook/lib/book-types'; import type { SiteConfig } from '@ebook/lib/site-types'; import { ContinueReading } from './ContinueReading'; import { InsightCarousel } from './InsightCarousel'; import { AnimatedCounter } from './AnimatedCounter'; import { ShareToX } from './ShareToX'; import { ScrollReveal } from './ScrollReveal'; import { SkillRadar } from './SkillRadar'; import { CoverChapterGrid } from './CoverChapterGrid'; import { CoverStickyCta, SiteFooter } from './GrowthKit'; import { CryptoSupport } from './CryptoSupport'; import { BuyEbook } from './BuyEbook'; import { AdSlot } from './AdSlot'; import { getBookShareText, getBookShareUrl } from '@ebook/lib/share-text'; import { trackEvent } from '@ebook/lib/analytics'; import { useEffect } from 'react'; import { isEnabled } from '@ebook/lib/features'; import { useT } from '@ebook/components/LocaleProvider'; import { LocaleSwitcher } from '@ebook/components/LocaleSwitcher'; import { ThemeToggle } from '@ebook/components/ThemeToggle'; import { useBookRoutes } from '@ebook/components/BookRoutes'; function CoverHomeLogo() { const { home } = useBookRoutes(); return ( nomadro · 小册 ); } export function CoverPage({ book, site, chapterMinutes, coverAdSlot = '', }: { book: Book; site: SiteConfig; chapterMinutes?: Record; coverAdSlot?: string; }) { const t = useT(); const shareText = getBookShareText(book); useEffect(() => { if (isEnabled.analytics()) trackEvent('cover_view'); }, []); return ( <> {book.viralTags.map((tag) => ( #{tag} ))} {book.title} {book.subtitle} {book.description} {book.stats.map((stat) => ( {stat.emoji} {stat.label} ))} 「{book.tagline}」 Digital Nomad × Homelab by {book.author} {book.title} {book.subtitle} {book.chapters.slice(0, 4).map((ch) => ( {ch.emoji} {ch.title} ))} {t('cover.moreChapters', { n: book.chapters.length - 4 })} {isEnabled.checkoutPay() && ( )} {isEnabled.cryptoPay() && ( )} {isEnabled.ads() && coverAdSlot && ( )} > ); }
{book.subtitle}
{book.description}
「{book.tagline}」
Digital Nomad × Homelab
by {book.author}