Problem
In src/components/Sidebar.tsx, the palette edit section maps over state.palette and renders two inputs per slot. Both the <input type="color"> and <input type="text"> share the same two-line handler written out twice inline:
onChange={(e) => { state.setPaletteColor(i, e.target.value); setSelectedPreset('custom'); }}
Affected lines: ~158–169.
Proposed fix
Extract the handler above the return:
const handlePaletteChange = (i: number, color: string) => {
state.setPaletteColor(i, color);
setSelectedPreset('custom');
};
Reference it from both inputs.
Problem
In
src/components/Sidebar.tsx, the palette edit section maps overstate.paletteand renders two inputs per slot. Both the<input type="color">and<input type="text">share the same two-line handler written out twice inline:Affected lines: ~158–169.
Proposed fix
Extract the handler above the return:
Reference it from both inputs.