import React, { useState } from 'react'; import { Layers, Check, Settings, X } from 'lucide-react'; import { useNavigate } from 'react-router-dom'; import { Recipe } from '../types'; import { TechButton } from './common/TechButton'; interface RecipePanelProps { recipes: Recipe[]; currentRecipe: Recipe; onSelectRecipe: (r: Recipe) => void; onClose: () => void; } export const RecipePanel: React.FC = ({ recipes, currentRecipe, onSelectRecipe, onClose }) => { const navigate = useNavigate(); const [selectedId, setSelectedId] = useState(currentRecipe.id); const handleConfirm = () => { const selected = recipes.find(r => r.id === selectedId); if (selected) { onSelectRecipe(selected); onClose(); } }; return (
{/* Header */}
RECIPE SELECTION
{/* List (Max height for ~5 items) */}
{recipes.map(recipe => (
setSelectedId(recipe.id)} className={` p-3 rounded border cursor-pointer transition-all flex items-center justify-between ${selectedId === recipe.id ? 'bg-neon-blue/20 border-neon-blue text-white shadow-[0_0_10px_rgba(0,243,255,0.2)]' : 'bg-white/5 border-white/10 text-slate-400 hover:bg-white/10 hover:border-white/20'} `} >
{recipe.name}
ID: {recipe.id} | MOD: {recipe.lastModified}
{selectedId === recipe.id && }
))}
{/* Footer Actions */}
navigate('/recipe')} > MANAGEMENT SELECT
); };