bluesky client without react native baggage written in sveltekit
1<script module>
2 import { defineMeta } from '@storybook/addon-svelte-csf';
3 import Post from './Post.svelte';
4
5 const basePost = {
6 uri: 'at://did:plc:example/app.bsky.feed.post/123',
7 cid: 'bafyreiexample',
8 author: {
9 did: 'did:plc:example',
10 handle: 'user.bsky.social',
11 displayName: 'Example User',
12 avatar: 'https://picsum.photos/seed/avatar/48/48'
13 },
14 record: {
15 $type: 'app.bsky.feed.post',
16 text: 'Hello world! This is an example Bluesky post.',
17 createdAt: '2024-01-01T00:00:00Z'
18 },
19 replyCount: 3,
20 repostCount: 12,
21 likeCount: 42,
22 indexedAt: '2024-01-01T00:00:00Z',
23 viewer: {}
24 };
25
26 const { Story } = defineMeta({
27 title: 'Components/Post',
28 component: Post,
29 tags: ['autodocs']
30 });
31</script>
32
33<Story name="Default" args={{ post: basePost }} />
34
35<Story name="Liked" args={{ post: { ...basePost, viewer: { like: 'at://liked' } } }} />
36
37<Story name="Reposted" args={{ post: { ...basePost, viewer: { repost: 'at://reposted' } } }} />
38
39<Story
40 name="WithImage"
41 args={{
42 post: {
43 ...basePost,
44 embed: {
45 $type: 'app.bsky.embed.images#view',
46 images: [
47 {
48 thumb: 'https://picsum.photos/seed/post/600/400',
49 alt: 'Example image',
50 fullsize: '',
51 aspectRatio: { width: 600, height: 400 }
52 }
53 ]
54 }
55 }
56 }}
57/>