/** * Sidebar — learner profile form with preset quick-load, * custom profile option, and auto-mode toggle. */ import React from "react"; import styles from "./Sidebar.module.css"; const ALL_TAGS = [ "python", "ml", "deployment", "kubernetes", "docker", "data-science", "pandas", "numpy", "deep-learning", "pytorch", "neural-networks", "mlops", "ci-cd", "monitoring", "nlp", "transformers", "bert", "llm", "prompt-engineering", "ai", "data-engineering", "spark", "big-data", "git", "github", "collaboration", "fastapi", "api", "backend", "aws", "sagemaker", ]; const STYLES = ["visual", "reading", "hands-on"]; const DIFFICULTIES = ["Beginner", "Intermediate", "Advanced"]; export default function Sidebar({ open, onToggle, profile, onChange, presets, activePreset, onPreset, onSubmit, loading, autoMode, onAutoModeChange, }) { const set = (key, val) => { const updated = { ...profile, [key]: val }; // When user edits fields on a preset, switch to custom user_id if (activePreset >= 0) { updated.user_id = "custom"; } onChange(updated); }; const toggleTag = (tag) => { const tags = profile.interest_tags || []; set( "interest_tags", tags.includes(tag) ? tags.filter((t) => t !== tag) : [...tags, tag] ); }; const toggleViewed = (id) => { const ids = profile.viewed_content_ids || []; set( "viewed_content_ids", ids.includes(id) ? ids.filter((i) => i !== id) : [...ids, id] ); }; return ( <> {open ? "\u2190" : "\u2192"} > ); }