Snapshot of uncommitted work: landing, bots, prod infra, partner cabinet, backoffice stage 1
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
45d7512d2b
commit
d452824c62
314 files changed
+44394
-121
No files matched your search
@@ -0,0 +1,26 @@
|
||||
/** Абзацы и списки из текста перевода: строки с «• » — пункты списка, остальные — абзацы */
|
||||
export function RichText({ text }: { text: string }) {
|
||||
const blocks: ({ kind: 'p'; text: string } | { kind: 'ul'; items: string[] })[] = [];
|
||||
for (const line of text.split('\n')) {
|
||||
if (line.startsWith('• ')) {
|
||||
const last = blocks.at(-1);
|
||||
if (last?.kind === 'ul') last.items.push(line.slice(2));
|
||||
else blocks.push({ kind: 'ul', items: [line.slice(2)] });
|
||||
} else if (line.trim()) blocks.push({ kind: 'p', text: line });
|
||||
}
|
||||
return (
|
||||
<>
|
||||
{blocks.map((b, i) =>
|
||||
b.kind === 'p' ? (
|
||||
<p key={i}>{b.text}</p>
|
||||
) : (
|
||||
<ul key={i}>
|
||||
{b.items.map((it) => (
|
||||
<li key={it}>{it}</li>
|
||||
))}
|
||||
</ul>
|
||||
),
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in new issue
Block a user