From 16b552887e7bac7868a84572ae15957c762a9c2c Mon Sep 17 00:00:00 2001 From: arsam Date: Fri, 18 Sep 2026 23:25:37 +0330 Subject: [PATCH] Import source: app/src/pages/SeriesPage Import the existing local project snapshot. This commit organizes existing files; it does not represent newly developed functionality. --- app/src/pages/SeriesPage.jsx | 51 ++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 app/src/pages/SeriesPage.jsx diff --git a/app/src/pages/SeriesPage.jsx b/app/src/pages/SeriesPage.jsx new file mode 100644 index 0000000..4a63c2f --- /dev/null +++ b/app/src/pages/SeriesPage.jsx @@ -0,0 +1,51 @@ +import { useState, useEffect } from 'react'; +import { useNav, EmptyState, pillBtn } from '../../teknav-ui.jsx'; +import { ArticleRow } from '../../teknav-articles.jsx'; +import { contentApi } from '../../src/lib/content-api.js'; + +export function SeriesPage({ slug }) { + const { navigate } = useNav(); + const [series, setSeries] = useState(null); + const [error, setError] = useState(false); + + useEffect(() => { + let cancelled = false; + setError(false); + contentApi.getSeries(slug) + .then((item) => { if (!cancelled) setSeries(item); }) + .catch(() => { if (!cancelled) setError(true); }); + return () => { cancelled = true; }; + }, [slug]); + + if (error) { + return ( +
+ +
+ ); + } + + if (!series) { + return
در حال بارگذاری...
; + } + + return ( +
+
+ +

{series.title}

+ {series.description &&

{series.description}

} + {(series.articles ?? []).length === 0 ? : ( +
+ {series.articles.map((item, index) => ( +
+
{(item.position ?? index + 1).toLocaleString('fa-IR')}
+ +
+ ))} +
+ )} +
+
+ ); +}