All checks were successful
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
29 lines
1.0 KiB
TypeScript
29 lines
1.0 KiB
TypeScript
import React from 'react'
|
|
import type { Dict } from '@/i18n'
|
|
import { bookShopLinks } from '@/lib/book-links'
|
|
|
|
function Shop({ name }: { name: string }) {
|
|
const href = bookShopLinks[name]
|
|
if (!href) return <>{name}</>
|
|
return <a href={href} target="_blank" rel="noopener noreferrer" className="underline underline-offset-4">{name}</a>
|
|
}
|
|
|
|
export function BookWhere({ t }: { t: Dict['book']; tbc?: string }) {
|
|
const buy = t.buy
|
|
if (!buy) return null
|
|
return (
|
|
<div className="mt-8">
|
|
<h4 className="font-serif text-xl sm:text-2xl">{t.get}</h4>
|
|
<p className="mt-3 text-muted">{buy.intro}</p>
|
|
<ul className="mt-3 list-disc space-y-1 pl-6 text-muted">
|
|
{buy.platforms.map((p) => <li key={p}><Shop name={p} /></li>)}
|
|
</ul>
|
|
<p className="mt-3 text-muted">{buy.storesIntro}</p>
|
|
<ul className="mt-3 list-disc space-y-1 pl-6 text-muted">
|
|
{buy.stores.map((p) => <li key={p}><Shop name={p} /></li>)}
|
|
</ul>
|
|
<p className="mt-3 text-muted">{buy.note}</p>
|
|
</div>
|
|
)
|
|
}
|