aboutsummaryrefslogtreecommitdiff
path: root/www-2/src/components/ArticlePreviewList.astro
blob: abe54f2b7f82be411015c3bedda0bebdcde8b274 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
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>