Skip to content

Commit 8636d6c

Browse files
committed
feat(component): add component PostItem
1 parent 9e5fee4 commit 8636d6c

File tree

1 file changed

+27
-0
lines changed

1 file changed

+27
-0
lines changed

src/components/post/PostItem.astro

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
---
2+
import Icon from '@/components/Icon.astro'
3+
4+
export interface Props {
5+
title: string
6+
href: string
7+
}
8+
9+
const { title, href } = Astro.props
10+
---
11+
12+
<a href={href}>
13+
<div class="post-item flex items-center justify-between">
14+
<div>
15+
<h2>{title}</h2>
16+
</div>
17+
<span class="px-2"><Icon name="bi:arrow-right" /></span>
18+
</div>
19+
</a>
20+
21+
<style lang="scss">
22+
.post-item {
23+
@apply mx-3 my-2 p-3;
24+
@apply border-2 border-solid border-style-primary;
25+
@apply hover:bg-style-primary text-style-secondary hover:text-style-primary-inverted;
26+
}
27+
</style>

0 commit comments

Comments
 (0)