From cbe29d5c54aa8dc58f6b82fcf0f8961f472e8132 Mon Sep 17 00:00:00 2001 From: Thomas Hallock Date: Sat, 8 Nov 2025 10:21:12 -0600 Subject: [PATCH] refactor(worksheets): extract StudentNameInput component (Phase 2 - partial) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Extracted Student Name input field to separate component as part of Phase 2. Changes: - Created StudentNameInput.tsx component (32 lines) - Updated ConfigPanel.tsx to use new component - File size reduced: 2306 → 2286 lines (-20 lines) Remaining Phase 2 work: Extract DigitRangeSection, OperatorSection, and ProgressiveDifficultyToggle components. 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude --- .../addition/components/ConfigPanel.tsx | 24 ++------------ .../config-panel/StudentNameInput.tsx | 33 +++++++++++++++++++ 2 files changed, 35 insertions(+), 22 deletions(-) create mode 100644 apps/web/src/app/create/worksheets/addition/components/config-panel/StudentNameInput.tsx diff --git a/apps/web/src/app/create/worksheets/addition/components/ConfigPanel.tsx b/apps/web/src/app/create/worksheets/addition/components/ConfigPanel.tsx index 348fb395..716b0b0b 100644 --- a/apps/web/src/app/create/worksheets/addition/components/ConfigPanel.tsx +++ b/apps/web/src/app/create/worksheets/addition/components/ConfigPanel.tsx @@ -32,6 +32,7 @@ import type { DisplayRules } from '../displayRules' import { getScaffoldingSummary } from './config-panel/utils' import { SubOption } from './config-panel/SubOption' import { ToggleOption } from './config-panel/ToggleOption' +import { StudentNameInput } from './config-panel/StudentNameInput' interface ConfigPanelProps { formState: WorksheetFormState @@ -203,28 +204,7 @@ export function ConfigPanel({ formState, onChange }: ConfigPanelProps) { return (
{/* Student Name */} - onChange({ name: e.target.value })} - placeholder="Student Name" - className={css({ - w: 'full', - px: '3', - py: '2', - border: '1px solid', - borderColor: 'gray.300', - rounded: 'lg', - fontSize: 'sm', - _focus: { - outline: 'none', - borderColor: 'brand.500', - ring: '2px', - ringColor: 'brand.200', - }, - _placeholder: { color: 'gray.400' }, - })} - /> + onChange({ name })} /> {/* Digit Range Selector */}
void +} + +export function StudentNameInput({ value, onChange }: StudentNameInputProps) { + return ( + onChange(e.target.value)} + placeholder="Student Name" + className={css({ + w: 'full', + px: '3', + py: '2', + border: '1px solid', + borderColor: 'gray.300', + rounded: 'lg', + fontSize: 'sm', + _focus: { + outline: 'none', + borderColor: 'brand.500', + ring: '2px', + ringColor: 'brand.200', + }, + _placeholder: { color: 'gray.400' }, + })} + /> + ) +}