2026-02-03 08:56:11 +00:00
|
|
|
import type { Meta, StoryObj } from '@storybook/react';
|
refactor(web): split AnalyticsView into analytics-view module
- types: AnalyticsViewProps, DateRangeKey, GlobalStats, TopTrackRow, TrafficSource, DeviceStats, ChartHoverData
- useAnalyticsView: dateRange, stats, topTracks, trafficSources, deviceStats, loading, hoveredData, handleExport
- AnalyticsViewHeader, AnalyticsViewKpiGrid, AnalyticsViewChart, AnalyticsViewOrigins, AnalyticsViewPlatforms, AnalyticsViewTopTracks, AnalyticsViewSkeleton
- Data via analyticsService; loading renders Skeleton
- text-[10px] -> text-xs, tracking-[0.2em] -> tracking-wide
- Stories: Default, Loading (Skeleton); decorator min-h-layout-page
- Re-export from AnalyticsView.tsx
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 17:33:42 +00:00
|
|
|
import { AnalyticsView, AnalyticsViewSkeleton } from './analytics-view';
|
2026-02-03 08:56:11 +00:00
|
|
|
|
|
|
|
|
const meta: Meta<typeof AnalyticsView> = {
|
refactor(web): split AnalyticsView into analytics-view module
- types: AnalyticsViewProps, DateRangeKey, GlobalStats, TopTrackRow, TrafficSource, DeviceStats, ChartHoverData
- useAnalyticsView: dateRange, stats, topTracks, trafficSources, deviceStats, loading, hoveredData, handleExport
- AnalyticsViewHeader, AnalyticsViewKpiGrid, AnalyticsViewChart, AnalyticsViewOrigins, AnalyticsViewPlatforms, AnalyticsViewTopTracks, AnalyticsViewSkeleton
- Data via analyticsService; loading renders Skeleton
- text-[10px] -> text-xs, tracking-[0.2em] -> tracking-wide
- Stories: Default, Loading (Skeleton); decorator min-h-layout-page
- Re-export from AnalyticsView.tsx
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 17:33:42 +00:00
|
|
|
title: 'Components/Features/Views/AnalyticsView',
|
|
|
|
|
component: AnalyticsView,
|
|
|
|
|
parameters: { layout: 'fullscreen' },
|
|
|
|
|
tags: ['autodocs'],
|
|
|
|
|
decorators: [
|
|
|
|
|
(Story) => (
|
|
|
|
|
<div className="bg-kodo-background min-h-layout-page">
|
|
|
|
|
<Story />
|
|
|
|
|
</div>
|
|
|
|
|
),
|
|
|
|
|
],
|
2026-02-03 08:56:11 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export default meta;
|
|
|
|
|
type Story = StoryObj<typeof meta>;
|
|
|
|
|
|
refactor(web): split AnalyticsView into analytics-view module
- types: AnalyticsViewProps, DateRangeKey, GlobalStats, TopTrackRow, TrafficSource, DeviceStats, ChartHoverData
- useAnalyticsView: dateRange, stats, topTracks, trafficSources, deviceStats, loading, hoveredData, handleExport
- AnalyticsViewHeader, AnalyticsViewKpiGrid, AnalyticsViewChart, AnalyticsViewOrigins, AnalyticsViewPlatforms, AnalyticsViewTopTracks, AnalyticsViewSkeleton
- Data via analyticsService; loading renders Skeleton
- text-[10px] -> text-xs, tracking-[0.2em] -> tracking-wide
- Stories: Default, Loading (Skeleton); decorator min-h-layout-page
- Re-export from AnalyticsView.tsx
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-06 17:33:42 +00:00
|
|
|
export const Loading: Story = {
|
|
|
|
|
name: 'Loading',
|
|
|
|
|
render: () => <AnalyticsViewSkeleton />,
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const Default: Story = {
|
|
|
|
|
name: 'Par défaut',
|
|
|
|
|
args: { onNavigateTrack: (id: string) => console.log('Navigate to track', id) },
|
|
|
|
|
};
|