···11+import type { Meta, StoryObj } from '@storybook/nextjs-vite';
22+import { CollectionAccessType } from '@semble/types';
33+import type { Collection } from '@semble/types';
44+import TextCard from './TextCard';
55+import { AuthContext } from '@/hooks/useAuth';
66+import type { AuthContextType } from '@/hooks/useAuth';
77+88+const mockAuthUser = {
99+ id: 'did:plc:mock123',
1010+ name: 'Test User',
1111+ handle: 'test.user',
1212+ avatarUrl: 'https://i.pravatar.cc/150?u=testuser',
1313+};
1414+1515+const mockAuthValue: AuthContextType = {
1616+ user: mockAuthUser as any,
1717+ isAuthenticated: true,
1818+ isLoading: false,
1919+ refreshAuth: async () => {},
2020+ logout: async () => {},
2121+};
2222+2323+const cardAuthor = {
2424+ id: 'did:plc:author456',
2525+ name: 'Jane Researcher',
2626+ handle: 'jane.researcher',
2727+ avatarUrl: 'https://i.pravatar.cc/150?u=jane',
2828+ description: 'Science writer and open-access advocate.',
2929+ followerCount: 214,
3030+ followingCount: 63,
3131+};
3232+3333+const baseCollection: Collection = {
3434+ id: 'col-story-001',
3535+ uri: 'at://did:plc:colauthor789/app.semble.collection/3juzt2xkr5c2a',
3636+ name: 'Research Notes',
3737+ author: {
3838+ id: 'did:plc:colauthor789',
3939+ name: 'Alex Curator',
4040+ handle: 'alex.curator',
4141+ avatarUrl: 'https://i.pravatar.cc/150?u=alex',
4242+ },
4343+ description: 'A curated collection of research notes and insights.',
4444+ accessType: CollectionAccessType.CLOSED,
4545+ cardCount: 24,
4646+ createdAt: '2024-09-15T12:00:00.000Z',
4747+ updatedAt: '2025-06-20T09:30:00.000Z',
4848+ isFollowing: false,
4949+ followerCount: 31,
5050+};
5151+5252+const baseCardContent = {
5353+ url: 'https://example.com/article-1',
5454+ title: 'How to Actually Enjoy Cooking at Home',
5555+ siteName: 'The Kitchn',
5656+ type: 'article',
5757+ retrievedAt: '2025-06-01T10:00:00.000Z',
5858+};
5959+6060+const meta: Meta<typeof TextCard> = {
6161+ title: 'Features/Cards/TextCard',
6262+ component: TextCard,
6363+ decorators: [
6464+ (Story) => (
6565+ <AuthContext.Provider value={mockAuthValue}>
6666+ <div style={{ maxWidth: 360 }}>
6767+ <Story />
6868+ </div>
6969+ </AuthContext.Provider>
7070+ ),
7171+ ],
7272+ args: {
7373+ id: 'card-txt-001',
7474+ cardContent: baseCardContent,
7575+ urlLibraryCount: 5,
7676+ urlIsInLibrary: false,
7777+ urlConnectionCount: 2,
7878+ urlIsConnected: false,
7979+ },
8080+};
8181+8282+export default meta;
8383+8484+type Story = StoryObj<typeof TextCard>;
8585+8686+export const Default: Story = {
8787+ args: {
8888+ text: "<p>The trick to enjoying cooking is to stop treating every meal like a project. Pick three recipes you actually like, rotate them during the week, and save the experiments for weekends when there's no pressure.</p>",
8989+ },
9090+};
9191+9292+export const RichFormatting: Story = {
9393+ args: {
9494+ id: 'card-txt-rich',
9595+ text: `<h3>Things I Changed This Year</h3>
9696+<p>I finally stopped buying groceries without a <strong>rough plan</strong> for the week. It sounds obvious, but it cut my food waste in <em>half</em>.</p>
9797+<ul>
9898+ <li>Check what's already in the <strong>fridge</strong> before shopping</li>
9999+ <li>Buy versatile ingredients that work in multiple meals</li>
100100+ <li>Freeze anything you won't use in two days</li>
101101+</ul>
102102+<blockquote>
103103+ <p>"The best meal plan is the one you actually stick to."</p>
104104+</blockquote>
105105+<p>Also started keeping a running note on my phone with a list of <code>go-to meals</code> so I never blank at the store again.</p>`,
106106+ cardContent: {
107107+ ...baseCardContent,
108108+ url: 'https://example.com/simple-meal-planning',
109109+ title: 'Simple Meal Planning for Busy People',
110110+ siteName: 'Budget Bytes',
111111+ },
112112+ },
113113+};
114114+115115+export const LongText: Story = {
116116+ args: {
117117+ id: 'card-txt-long',
118118+ text: `<p>I've been thinking a lot about how we pick up habits without realizing it. Most of the things I do every morning — checking my phone, making coffee in a specific order, even the route I walk to the train — started without any conscious decision.</p>
119119+<p>What's interesting is that <strong>small disruptions</strong> to routine can feel weirdly unsettling. When my usual coffee shop closed for renovation last month, it threw off my whole morning for a week. I started arriving at work later and feeling groggy until noon.</p>
120120+<p>Eventually I found a new place two blocks further, and now I actually prefer it. The walk is longer but I pass through a park, which turns out to be a much nicer way to start the day than staring at traffic.</p>
121121+<p>The lesson I keep re-learning: the things that feel like inconveniences in the moment often push you toward something better, but only if you let them.</p>
122122+<p>I wonder how many other parts of my routine could use a gentle shake-up. Maybe it's time to audit the defaults I've been living on autopilot.</p>`,
123123+ cardContent: {
124124+ ...baseCardContent,
125125+ url: 'https://example.com/daily-habits',
126126+ title: 'The Hidden Power of Everyday Routines',
127127+ siteName: 'Psyche Magazine',
128128+ },
129129+ },
130130+};
131131+132132+export const InLibrary: Story = {
133133+ args: {
134134+ id: 'card-txt-library',
135135+ urlIsInLibrary: true,
136136+ urlLibraryCount: 42,
137137+ text: '<p>This is a really solid breakdown of how to organize a small apartment. The bit about <strong>vertical storage</strong> in the kitchen freed up so much counter space when I tried it at home.</p>',
138138+ cardContent: {
139139+ ...baseCardContent,
140140+ url: 'https://example.com/small-space-living',
141141+ title: 'Making the Most of a Small Kitchen',
142142+ siteName: 'Apartment Therapy',
143143+ },
144144+ },
145145+};
146146+147147+export const Connected: Story = {
148148+ args: {
149149+ id: 'card-txt-connected',
150150+ urlIsConnected: true,
151151+ urlConnectionCount: 8,
152152+ text: "<p>I like how this frames budgeting not as restriction but as <em>clarity</em>. Knowing where your money goes each month isn't about cutting fun — it's about making sure the fun stuff is actually what you'd choose on purpose.</p>",
153153+ cardContent: {
154154+ ...baseCardContent,
155155+ url: 'https://example.com/budgeting-mindset',
156156+ title: 'A Healthier Way to Think About Money',
157157+ siteName: 'The Financial Diet',
158158+ },
159159+ },
160160+};
161161+162162+export const WithCollection: Story = {
163163+ args: {
164164+ id: 'card-txt-collection',
165165+ currentCollection: baseCollection,
166166+ cardAuthor: cardAuthor,
167167+ authorHandle: cardAuthor.handle,
168168+ text: "<p>Great advice in here about running a book club that people actually show up to. The key is keeping it casual — pick shorter books, don't guilt people for not finishing, and always have <strong>snacks</strong>.</p>",
169169+ cardContent: {
170170+ ...baseCardContent,
171171+ url: 'https://example.com/book-club-tips',
172172+ title: 'How to Run a Book Club That Lasts',
173173+ siteName: 'Literary Hub',
174174+ },
175175+ },
176176+};
177177+178178+export const ShortText: Story = {
179179+ args: {
180180+ id: 'card-txt-short',
181181+ text: '<p>The photos in this one are gorgeous.</p>',
182182+ cardContent: {
183183+ ...baseCardContent,
184184+ url: 'https://example.com/travel-photos',
185185+ title: 'A Weekend in the Cotswolds',
186186+ siteName: 'Condé Nast Traveller',
187187+ },
188188+ },
189189+};
···11/// <reference types="next" />
22/// <reference types="next/image-types/global" />
33-import "./.next/dev/types/routes.d.ts";
33+import "./.next/types/routes.d.ts";
4455// NOTE: This file should not be edited
66// see https://nextjs.org/docs/app/api-reference/config/typescript for more information.