Skip to content

Commit 20841e2

Browse files
authored
Merge pull request #615 from romainpi/note-component
Implement properties for `Note` component
2 parents a5a32d5 + 1b565c8 commit 20841e2

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

src/components/widgets/Note.astro

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,23 @@
11
---
22
import { Icon } from 'astro-icon/components';
3+
4+
export interface Props {
5+
icon?: string;
6+
title?: string;
7+
description?: string;
8+
}
9+
10+
const {
11+
icon = 'tabler:info-square',
12+
title = await Astro.slots.render('title'),
13+
description = await Astro.slots.render('description'),
14+
} = Astro.props;
315
---
416

517
<section class="bg-blue-50 dark:bg-slate-800 not-prose">
618
<div class="max-w-6xl mx-auto px-4 sm:px-6 py-4 text-md text-center font-medium">
7-
<span class="font-bold">
8-
<Icon name="tabler:info-square" class="w-5 h-5 inline-block align-text-bottom" /> Philosophy:</span
9-
> Simplicity, Best Practices and High Performance
19+
<Icon name={icon} class="w-5 h-5 inline-block align-text-bottom font-bold" />
20+
<span class="font-bold" set:html={title} />
21+
<Fragment set:html={description} />
1022
</div>
1123
</section>

src/pages/index.astro

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const metadata = {
5252

5353
<!-- Note Widget ******************* -->
5454

55-
<Note />
55+
<Note title="Philosophy:" description="Simplicity, Best Practices and High Performance" />
5656

5757
<!-- Features Widget *************** -->
5858

0 commit comments

Comments
 (0)