1import { useParams } from 'react-router-dom';
2import DocsLayout from './DocsLayout';
3import { guides } from './guides/index';
4import { docGroups } from './docsData';
6function SectionRenderer({ section }) {
9 <ol className="step-list">
10 {section.steps.map((s, idx) => (
12 <strong>{s.title}</strong>
22 {section.list.map((li, idx) => (
23 <li key={idx}>{li}</li>
30 <ul className="doc-links">
31 {section.links.map((link, idx) => (
33 <a href={link.url}>{link.title}</a>
41export default function DocPage() {
42 const { slug } = useParams();
43 let doc = guides.find((g) => g.slug === slug);
45 // Search docGroups for the slug if not found in guides
46 for (const group of docGroups) {
47 const found = group.items.find((i) => i.slug === slug);
58 <section className="doc-section">
60 <p>The requested documentation page does not exist.</p>
68 <section className="doc-section">
70 <span className="material-symbols-outlined" style={{ verticalAlign: '-6px', marginRight: 8 }}>{doc.icon}</span>
73 {doc.summary && <p className="lead">{doc.summary}</p>}
75 <div className="doc-image-placeholder">
76 <img src={doc.image} alt={`${doc.title} preview`} onError={(e) => e.target.style.display = 'none'} />
81 {doc.sections?.map((s, i) => (
82 <section className="doc-section" key={i}>
83 {s.heading && <h2>{s.heading}</h2>}
84 <SectionRenderer section={s} />