feat(blocks): add Localized type support to full-guide blocks

Widens prose props on FleetDiagram, HandoffTable, PhasePanel, RouteTable, SkillPackage, and WorktreeMap to accept {en, pt} as well as string, and conditionally renders language spans. Non-prose props (id, code, etc) were left as strings.
This commit is contained in:
Marcos Paulo
2026-09-05 21:59:29 +00:00
parent a5d9630dd8
commit cac1115035
6 changed files with 311 additions and 39 deletions
+15 -2
View File
@@ -7,12 +7,14 @@
// paired with a `<article>` detail panel by the parent page; this component
// renders only the picker.
type Localized = { en: string; pt: string };
interface PackageFile {
id: 'skill' | 'references' | 'scripts' | 'assets' | string;
/** Path rendered inside `<code>`, e.g. "SKILL.md". */
path: string;
/** Helper copy under the path. */
small: string;
small: string | Localized;
}
interface Props {
@@ -34,7 +36,18 @@ const { files, initial = files[0]?.id ?? 'skill' } = Astro.props;
aria-selected={file.id === initial}
>
<code>{file.path}</code>
<small>{file.small}</small>
<small>
{typeof file.small === 'string' ? (
file.small
) : (
<>
<span data-language-content="en">{file.small.en}</span>
<span data-language-content="pt" hidden>
{file.small.pt}
</span>
</>
)}
</small>
</button>
))
}