diff options
Diffstat (limited to 'www-2/src/components/ArticlePreviewList.astro')
| -rw-r--r-- | www-2/src/components/ArticlePreviewList.astro | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/www-2/src/components/ArticlePreviewList.astro b/www-2/src/components/ArticlePreviewList.astro new file mode 100644 index 0000000..abe54f2 --- /dev/null +++ b/www-2/src/components/ArticlePreviewList.astro @@ -0,0 +1,35 @@ +--- +import ArticlePreview, { + type Props as ArticlePreviewProps, +} from "./ArticlePreview.astro"; + +type Props = { + articles: ArticlePreviewProps["article"][]; +} & Omit<ArticlePreviewProps, "article">; + +export type { Props }; + +const { articles, ...otherProps } = Astro.props; +--- + +{ + articles.length > 0 && ( + <ArticlePreview article={articles[0]} {...otherProps} /> + ) +} + +{ + articles.slice(1).map((a) => ( + <> + <hr class="article-preview-hr" /> + <ArticlePreview article={a} {...otherProps} /> + </> + )) +} + +<style> + hr.article-preview-hr { + border: none; + border-top: 1.5px dashed currentColor; + } +</style> |
