import React, { useState } from 'react'; import { motion, AnimatePresence } from 'framer-motion'; const CONDITION_CONFIG = { ideal: { label: 'Ideal Storage', icon: '❄️', color: 'blue', gradient: 'from-blue-500/20 to-blue-600/10', border: 'border-blue-500/40', textColor: 'text-blue-400', dotColor: 'bg-blue-400', }, room: { label: 'Room Temperature', icon: '🏠', color: 'amber', gradient: 'from-amber-500/20 to-amber-600/10', border: 'border-amber-500/40', textColor: 'text-amber-400', dotColor: 'bg-amber-400', }, high_humidity: { label: 'High Humidity', icon: '💧', color: 'red', gradient: 'from-red-500/20 to-red-600/10', border: 'border-red-500/40', textColor: 'text-red-400', dotColor: 'bg-red-400', }, }; const TipsModal = ({ tips, fruit, onClose }) => { const [activeTab, setActiveTab] = useState('ideal'); if (!tips) return null; const conditions = Object.keys(CONDITION_CONFIG); return ( {/* Backdrop */}
{/* Modal */} e.stopPropagation()} className="relative w-full max-w-lg max-h-[85vh] overflow-hidden glass rounded-3xl border border-dark-600/50 shadow-2xl" > {/* Header */}
💡

Storage Tips

How to store {fruit} properly

{/* Tabs */}
{conditions.map((key) => { const cfg = CONDITION_CONFIG[key]; const isActive = activeTab === key; return ( ); })}
{/* Tips Content */}
{tips[activeTab]?.map((tip, index) => { const cfg = CONDITION_CONFIG[activeTab]; return (

{tip}

); })}
{/* Footer */}

Tips are tailored for {fruit}. Always inspect produce before consuming.

); }; export default TipsModal;