- Fix 98 TypeScript errors across 37 files: - Service layer double-unwrapping (subscriptionService, distributionService, gearService) - Self-referencing variables in SearchPageResults - FeedView/ExploreView .posts→.items alignment - useQueueSync Zustand subscribe API - AdminAuditLogsView missing interface fields - Toast proxy type, interceptor type narrowing - 22 unused imports/variables removed - 5 storybook mock data fixes - Align frontend API calls with backend endpoints: - Analytics: useAnalyticsView now calls /creator/analytics/dashboard (was /analytics) - Chat: chatService uses /conversations (was mock data), WS URL from backend token - Dashboard StatsSection: uses real /dashboard API data (was hardcoded zeros) - Settings: suppress 2FA toast error when endpoint unavailable - Fix marketplace products: seed uses 'active' status (was 'published') - Enrich seed: admin follows all creators (feed has content) - Optimize bundle: vendor catch-all 793KB→318KB gzip (-60%) Split into vendor-charts, vendor-emoji, vendor-swagger, vendor-media, etc. - Clean repo: remove ~100 orphaned screenshots, audit reports, logs from root Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
55 lines
1.2 KiB
TypeScript
55 lines
1.2 KiB
TypeScript
import type { Meta, StoryObj } from '@storybook/react';
|
|
import { GearImageGallery } from './GearImageGallery';
|
|
|
|
const mockImages = [
|
|
{
|
|
id: 'img1',
|
|
image_url: 'https://placehold.co/600x400/1a1a2e/e94560?text=Front+View',
|
|
position: 0,
|
|
},
|
|
{
|
|
id: 'img2',
|
|
image_url: 'https://placehold.co/600x400/16213e/0f3460?text=Side+View',
|
|
position: 1,
|
|
},
|
|
{
|
|
id: 'img3',
|
|
image_url: 'https://placehold.co/600x400/1a1a2e/533483?text=Detail',
|
|
position: 2,
|
|
},
|
|
];
|
|
|
|
const meta: Meta<typeof GearImageGallery> = {
|
|
title: 'Inventory/GearImageGallery',
|
|
component: GearImageGallery,
|
|
decorators: [
|
|
(Story) => (
|
|
<div className="max-w-md p-6">
|
|
<Story />
|
|
</div>
|
|
),
|
|
],
|
|
};
|
|
|
|
export default meta;
|
|
type Story = StoryObj<typeof GearImageGallery>;
|
|
|
|
export const WithImages: Story = {
|
|
args: { images: mockImages },
|
|
};
|
|
|
|
export const SingleImage: Story = {
|
|
args: { images: [mockImages[0]!] },
|
|
};
|
|
|
|
export const Empty: Story = {
|
|
args: { images: [], onAddImage: () => console.log('Add image') },
|
|
};
|
|
|
|
export const Editable: Story = {
|
|
args: {
|
|
images: mockImages.slice(0, 2),
|
|
onAddImage: () => console.log('Add image'),
|
|
onRemoveImage: (id: string) => console.log('Remove image', id),
|
|
},
|
|
};
|