This repository has no description
1<script module lang="ts">
2 import { defineMeta } from "@storybook/addon-svelte-csf";
3 import MockAuthProvider from "$lib/components/testing/MockAuthProvider.svelte";
4 import Timeline from "./Timeline.svelte";
5 import type * as ShTangledFeedGetTimeline from "$lib/api/lexicons/types/sh/tangled/feed/getTimeline";
6
7 const owner = { did: "did:plc:3p7ejjxnufohsygt5vbyxb2i", handle: "tangled.org" };
8 const alice = { did: "did:plc:oky5czdrnfjpqslsw2a5iclo", handle: "alice.tngl.sh" };
9
10 const repo = {
11 did: "did:plc:3p7ejjxnufohsygt5vbyxb2i",
12 slug: "core",
13 owner,
14 createdAt: "2025-06-01T10:30:00Z",
15 description: "The knot server, appview, and everything that makes tangled tick.",
16 starCount: 42
17 };
18
19 const feed = [
20 {
21 event: {
22 $type: "sh.tangled.feed.getTimeline#repoEvent",
23 cid: "bafyreib1",
24 uri: "at://did:plc:3p7ejjxnufohsygt5vbyxb2i/sh.tangled.repo/core",
25 repo
26 },
27 eventAt: "2025-06-04T09:00:00Z"
28 },
29 {
30 event: {
31 $type: "sh.tangled.feed.getTimeline#starEvent",
32 cid: "bafyreib2",
33 uri: "at://did:plc:oky5czdrnfjpqslsw2a5iclo/sh.tangled.feed.star/3l",
34 actor: alice,
35 repo
36 },
37 eventAt: "2025-06-03T18:20:00Z"
38 },
39 {
40 event: {
41 $type: "sh.tangled.feed.getTimeline#followEvent",
42 cid: "bafyreib3",
43 uri: "at://did:plc:oky5czdrnfjpqslsw2a5iclo/sh.tangled.graph.follow/3l",
44 actor: alice,
45 subject: {
46 did: "did:plc:3p7ejjxnufohsygt5vbyxb2i",
47 handle: "joshka.net",
48 description: "Rust, TUIs, and the occasional git plumbing yak-shave.",
49 followersCount: 128,
50 followsCount: 87
51 }
52 },
53 eventAt: "2025-06-02T12:00:00Z"
54 },
55 {
56 event: {
57 $type: "sh.tangled.feed.getTimeline#repoEvent",
58 cid: "bafyreib4",
59 uri: "at://did:plc:3p7ejjxnufohsygt5vbyxb2i/sh.tangled.repo/core-fork",
60 repo: { ...repo, slug: "core-fork" },
61 source: repo
62 },
63 eventAt: "2025-06-01T08:00:00Z"
64 }
65 ] as unknown as ShTangledFeedGetTimeline.$output["feed"];
66
67 const { Story } = defineMeta({
68 title: "Timeline/Timeline",
69 component: Timeline,
70 tags: ["autodocs"],
71 args: { feed }
72 });
73</script>
74
75<Story name="Default">
76 {#snippet template(args)}
77 <MockAuthProvider>
78 <Timeline {...args} />
79 </MockAuthProvider>
80 {/snippet}
81</Story>
82
83<Story name="Empty" args={{ feed: [], emptyMessage: "Nothing here yet." }} />