import * as React from 'react' import { cn } from '../../lib/utils' export interface PeriodOption { value: string label: string } export interface PeriodSelectorProps { periods?: PeriodOption[] selected: string onChange: (value: string) => void className?: string } const DEFAULT_PERIODS: PeriodOption[] = [ { value: 'week', label: 'Week' }, { value: 'month', label: 'Month' }, { value: 'quarter', label: 'Quarter' }, { value: 'year', label: 'Year' }, ] export function PeriodSelector({ periods = DEFAULT_PERIODS, selected, onChange, className, }: PeriodSelectorProps) { return (
{periods.map(({ value, label }) => ( ))}
) }