'use client'; import { useMemo } from 'react'; import { Card } from '@/components/ui/card'; import { Button } from '@/components/ui/button'; import { Shuffle } from 'lucide-react'; import { cn } from '@/lib/utils'; import { drumPatterns } from '@/lib/audio/patterns'; interface PatternPickerProps { selectedIndex: number | null; onSelect: (index: number) => void; onRandom: () => void; onClose: () => void; className?: string; } const patternNames = [ 'Classic Boom Bap', 'Laid Back Groove', 'Minimal Chill', 'Jazzy Swing', 'Deep Pocket', ]; function PatternPreview({ pattern }: { pattern: typeof drumPatterns[0] }) { return (
{Array.from({ length: 16 }, (_, i) => { const hasKick = pattern.kick[i]; const hasSnare = pattern.snare[i]; const hasHihat = pattern.hihat[i]; const hasOpenhat = pattern.openhat[i]; return (
{hasKick &&
} {hasSnare &&
} {(hasHihat || hasOpenhat) && (
)}
); })}
); } export function PatternPicker({ selectedIndex, onSelect, onRandom, onClose, className, }: PatternPickerProps) { return ( e.stopPropagation()} >
Drum Patterns
{drumPatterns.map((pattern, i) => ( ))}
); }