import { useRef } from 'react'; import { useQR } from '../../context/QRContext'; import { ColorSwatch } from '../ui/ColorSwatch'; import { QR_COLORS, BG_COLORS } from '../../config/styleOptions'; export function ColorsSection() { const { state, dispatch } = useQR(); const qrPickerRef = useRef(null); const bgPickerRef = useRef(null); return (

Colors

QR Code
{QR_COLORS.map(color => ( dispatch({ type: 'SET_QR_COLOR', payload: color })} /> ))} {/* Custom picker */}
{!QR_COLORS.includes(state.qrColor) && (
{state.qrColor}
)}
Background
{BG_COLORS.map((color, i) => ( dispatch({ type: 'SET_BG_COLOR', payload: color })} /> ))} {/* Custom bg picker */}
); }