refactor(worksheets): extract StudentNameInput component (Phase 2 - partial)

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 <noreply@anthropic.com>
This commit is contained in:
Thomas Hallock 2025-11-08 10:21:12 -06:00
parent 3656800534
commit cbe29d5c54
2 changed files with 35 additions and 22 deletions

View File

@ -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 (
<div data-component="config-panel" className={stack({ gap: '3' })}>
{/* Student Name */}
<input
type="text"
value={formState.name || ''}
onChange={(e) => 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' },
})}
/>
<StudentNameInput value={formState.name} onChange={(name) => onChange({ name })} />
{/* Digit Range Selector */}
<div

View File

@ -0,0 +1,33 @@
import { css } from '../../../../../../../styled-system/css'
export interface StudentNameInputProps {
value: string | undefined
onChange: (value: string) => void
}
export function StudentNameInput({ value, onChange }: StudentNameInputProps) {
return (
<input
type="text"
value={value || ''}
onChange={(e) => 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' },
})}
/>
)
}