Create a DistributionTrends component that helps bank staff visualize item distribution patterns over time.
Props:
interface DistributionTrendsProps {
orgId: string
itemId?: string // optional: filter to a specific item
dateRange: { from: Date, to: Date }
}
The component should:
GET /api/distributions?orgId=X&itemId=Y&from=Z&to=W — you'll also build this route. It returns { week: string, unitsDistributed: number, distributionCount: number }[]ComposedChart — bar chart for unitsDistributed, line chart on a secondary Y-axis for distributionCountUse server components for the data fetch wrapper; client component only for the interactive filter bar and chart rendering.
No contributions yet.