2026-02-03 08:56:11 +00:00
|
|
|
import type { Meta, StoryObj } from '@storybook/react';
|
2026-02-07 04:46:16 +00:00
|
|
|
import { EquipmentDetailView, EquipmentDetailViewSkeleton } from './equipment-detail-view';
|
|
|
|
|
import { ToastProvider } from '@/components/feedback/ToastProvider';
|
2026-02-03 08:56:11 +00:00
|
|
|
|
|
|
|
|
const meta: Meta<typeof EquipmentDetailView> = {
|
2026-02-07 04:46:16 +00:00
|
|
|
title: 'Components/Features/Inventory/EquipmentDetailView',
|
|
|
|
|
component: EquipmentDetailView,
|
|
|
|
|
parameters: { layout: 'fullscreen' },
|
|
|
|
|
tags: ['autodocs'],
|
|
|
|
|
decorators: [
|
|
|
|
|
(Story) => (
|
|
|
|
|
<ToastProvider>
|
|
|
|
|
<div className="bg-background min-h-screen">
|
|
|
|
|
<Story />
|
|
|
|
|
</div>
|
|
|
|
|
</ToastProvider>
|
|
|
|
|
),
|
|
|
|
|
],
|
2026-02-03 08:56:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default meta;
|
|
|
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
|
|
2026-02-07 04:46:16 +00:00
|
|
|
const mockItem = {
|
|
|
|
|
id: '1',
|
|
|
|
|
name: 'Prophet-6',
|
|
|
|
|
category: 'Synth',
|
|
|
|
|
brand: 'Sequential',
|
|
|
|
|
model: 'Desktop',
|
|
|
|
|
serialNumber: 'SQ-P6-99281',
|
|
|
|
|
purchaseDate: '2023-01-15',
|
|
|
|
|
purchasePrice: 2499,
|
|
|
|
|
currency: 'USD' as const,
|
|
|
|
|
status: 'Active' as const,
|
|
|
|
|
condition: 'Mint' as const,
|
|
|
|
|
vendor: 'Sweetwater',
|
|
|
|
|
image: 'https://picsum.photos/id/100/400/400',
|
|
|
|
|
warrantyExpire: '2025-01-15',
|
|
|
|
|
warrantyType: 'Manufacturer' as const,
|
|
|
|
|
supportContact: 'support@sequential.com',
|
|
|
|
|
specs: { Keys: '6', Type: 'Analog' },
|
|
|
|
|
documents: [
|
|
|
|
|
{ name: 'Manual.pdf', type: 'manual' as const, url: '#' },
|
|
|
|
|
{ name: 'Receipt.pdf', type: 'receipt' as const, url: '#' },
|
|
|
|
|
],
|
|
|
|
|
maintenanceHistory: [
|
|
|
|
|
{
|
|
|
|
|
id: 'm1',
|
|
|
|
|
date: '2024-01-10',
|
|
|
|
|
type: 'Calibration',
|
|
|
|
|
notes: 'Full calibration done.',
|
|
|
|
|
},
|
|
|
|
|
],
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const Default: Story = {
|
|
|
|
|
args: {
|
|
|
|
|
itemId: '1',
|
|
|
|
|
onBack: () => {},
|
|
|
|
|
initialItem: mockItem,
|
|
|
|
|
},
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const Loading: Story = {
|
|
|
|
|
name: 'Chargement',
|
|
|
|
|
render: () => <EquipmentDetailViewSkeleton />,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const NotFound: Story = {
|
|
|
|
|
name: 'Non trouvé',
|
|
|
|
|
args: {
|
|
|
|
|
itemId: 'nonexistent',
|
|
|
|
|
onBack: () => {},
|
|
|
|
|
initialItem: null,
|
|
|
|
|
},
|
|
|
|
|
};
|