Skip to content

Commit b6976e2

Browse files
committed
feat: added author component
1 parent c9a98f4 commit b6976e2

File tree

1 file changed

+39
-0
lines changed

1 file changed

+39
-0
lines changed

src/components/ui/Author.astro

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
---
2+
import { Image } from 'astro:assets';
3+
import type { AuthorInfo } from '@/lib/constants';
4+
5+
interface Props extends AuthorInfo {}
6+
const { avatar, name, headline, username, location, pronouns } = Astro.props;
7+
---
8+
9+
<div class="flex items-center gap-4">
10+
<div class="relative rounded-full shrink-0 overflow-hidden">
11+
<Image
12+
loading="eager"
13+
src={avatar.src}
14+
alt={name}
15+
width={92}
16+
height={92}
17+
class="rounded-full"
18+
/>
19+
</div>
20+
<div class="flex flex-col gap-2">
21+
<div class="flex flex-col gap-0.5">
22+
<h1 class="text-xl font-semibold text-headings leading-tight">{name}</h1>
23+
<p class="text-base text-foreground leading-tight">
24+
{headline} in {' '}
25+
<span>
26+
{location}
27+
</span>,
28+
{pronouns && (
29+
<span>
30+
{pronouns}
31+
</span>
32+
)}
33+
</p>
34+
</div>
35+
<span class="text-foreground text-sm bg-muted-foreground/40 px-2 py-1 rounded-full w-max leading-none">
36+
{username}
37+
</span>
38+
</div>
39+
</div>

0 commit comments

Comments
 (0)