29 lines
943 B
TypeScript
29 lines
943 B
TypeScript
import React from 'react'
|
|
import type { Dict } from '@/i18n'
|
|
import { bookUrl, marwinUrl } from '@/lib/home-model'
|
|
|
|
const storeUrls: Record<string, string> = { Marwin: marwinUrl, 'Flip.kz': bookUrl }
|
|
|
|
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) => {
|
|
const href = storeUrls[p]
|
|
return (
|
|
<li key={p}>
|
|
{href ? <a href={href} target="_blank" rel="noopener noreferrer" className="underline">{p}</a> : p}
|
|
</li>
|
|
)
|
|
})}
|
|
</ul>
|
|
<p className="mt-3 text-muted">{buy.stores}</p>
|
|
<p className="mt-3 text-muted">{buy.note}</p>
|
|
</div>
|
|
)
|
|
}
|