Skip to content

Commit 28c4bcd

Browse files
committed
fix: docs added
1 parent b5f75db commit 28c4bcd

1 file changed

Lines changed: 27 additions & 0 deletions

File tree

platforms/metagram/src/lib/fragments/UserRequest/UserRequest.svelte

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,30 @@
2525
</div>
2626
<Button class="max-w-[100px]" variant="secondary" size="sm" callback={handleFollow}>Follow</Button>
2727
</article>
28+
29+
<!--
30+
@component
31+
@name UserRequest
32+
@description A user request card component displaying avatar, name, description, and a follow button.
33+
@props
34+
- userImgSrc: URL string for the user's avatar image.
35+
- userName: Display name of the user.
36+
- description: A short description or context for the request.
37+
- handleFollow: Async function to execute when the "Follow" button is clicked.
38+
- (spread) HTMLAttributes<HTMLElement>: Additional HTML attributes passed to the root <article> element.
39+
@usage
40+
<script>
41+
import UserRequest from '$lib/fragments/UserRequest.svelte';
42+
43+
async function followUser() {
44+
console.log("User followed!");
45+
}
46+
</script>
47+
48+
<UserRequest
49+
userImgSrc="https://picsum.photos/id/237/200"
50+
userName="John Doe"
51+
description="Wants to connect with you"
52+
handleFollow={followUser}
53+
/>
54+
-->

0 commit comments

Comments
 (0)