diff --git a/apps/web/src/app/create/worksheets/addition/components/config-panel/DifficultyPresetDropdown.tsx b/apps/web/src/app/create/worksheets/addition/components/config-panel/DifficultyPresetDropdown.tsx new file mode 100644 index 00000000..4d8dee11 --- /dev/null +++ b/apps/web/src/app/create/worksheets/addition/components/config-panel/DifficultyPresetDropdown.tsx @@ -0,0 +1,322 @@ +'use client' + +import type React from 'react' +import * as DropdownMenu from '@radix-ui/react-dropdown-menu' +import { css } from '../../../../../../../styled-system/css' +import { + DIFFICULTY_PROFILES, + DIFFICULTY_PROGRESSION, + calculateRegroupingIntensity, + type DifficultyLevel, +} from '../../difficultyProfiles' +import type { DisplayRules } from '../../displayRules' +import { getScaffoldingSummary } from './utils' + +export interface DifficultyPresetDropdownProps { + currentProfile: DifficultyLevel | null + isCustom: boolean + nearestEasier: DifficultyLevel | null + nearestHarder: DifficultyLevel | null + customDescription: React.ReactNode + hoverPreview: { + pAnyStart: number + pAllStart: number + displayRules: DisplayRules + matchedProfile: string | 'custom' + } | null + operator: 'addition' | 'subtraction' | 'mixed' + onChange: (updates: { + difficultyProfile: DifficultyLevel + pAnyStart: number + pAllStart: number + displayRules: DisplayRules + }) => void + isDark?: boolean +} + +export function DifficultyPresetDropdown({ + currentProfile, + isCustom, + nearestEasier, + nearestHarder, + customDescription, + hoverPreview, + operator, + onChange, + isDark = false, +}: DifficultyPresetDropdownProps) { + return ( +