qazaq-legacy-foundation-web/src/components/BookWhere.tsx
Peppa 1102a55010
All checks were successful
peppa/lint lint: success за 2с
peppa/typecheck typecheck: success за 2с
peppa/test test: success за 0с
peppa/build build: success за 43с
ci / checks (pull_request) Successful in 1m21s
deploy / deploy (pull_request) Successful in 16s
QLFW-50: ссылки на магазины в блоке «Где купить книгу»
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
2026-11-17 19:04:58 +05:00

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>
)
}