Spaces:
Sleeping
Sleeping
Antigravity AI commited on
Commit ·
ef5357e
1
Parent(s): b225792
Add hardcoded fallback for menu items to ensure digital menu is never empty on HF
Browse files- src/pages/CustomerMenu.jsx +20 -4
src/pages/CustomerMenu.jsx
CHANGED
|
@@ -5,10 +5,26 @@ import { ref, onValue, push, set } from 'firebase/database';
|
|
| 5 |
import { Utensils, Star, Clock, MapPin, ChefHat, Instagram, Facebook, ArrowRight, MessageSquare, Send } from 'lucide-react';
|
| 6 |
|
| 7 |
export default function CustomerMenu() {
|
| 8 |
-
const
|
| 9 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 10 |
const [activeCategory, setActiveCategory] = useState('Todos');
|
| 11 |
-
const [menuTheme, setMenuTheme] = useState('
|
| 12 |
const [feedback, setFeedback] = useState({ rating: 5, comment: '' });
|
| 13 |
const [submitted, setSubmitted] = useState(false);
|
| 14 |
const [cartCount, setCartCount] = useState(0);
|
|
@@ -37,7 +53,7 @@ export default function CustomerMenu() {
|
|
| 37 |
: menuItems.filter(item => item.category === activeCategory);
|
| 38 |
|
| 39 |
const isDark = menuTheme === 'dark';
|
| 40 |
-
// Forzamos modo claro si el usuario lo pidió
|
| 41 |
const forceLight = true;
|
| 42 |
|
| 43 |
const themeColors = {
|
|
|
|
| 5 |
import { Utensils, Star, Clock, MapPin, ChefHat, Instagram, Facebook, ArrowRight, MessageSquare, Send } from 'lucide-react';
|
| 6 |
|
| 7 |
export default function CustomerMenu() {
|
| 8 |
+
const defaultItems = [
|
| 9 |
+
{ id: 'h1', name: 'Hamburgesa Clásica', price: 12.50, category: 'Fuertes', image: '/images/burger.png', active: true },
|
| 10 |
+
{ id: 'p1', name: 'Pasta Pomodoro', price: 10.00, category: 'Pasta', image: '/images/pasta.png', active: true },
|
| 11 |
+
{ id: 't1', name: 'Tacos de Pollo', price: 9.00, category: 'Entradas', image: '/images/tacos.png', active: true },
|
| 12 |
+
{ id: 'z1', name: 'Pizza Margherita', price: 14.00, category: 'Pizzas', image: '/images/pizza.png', active: true },
|
| 13 |
+
{ id: 'e1', name: 'Ensalada César', price: 8.50, category: 'Entradas', image: 'https://images.unsplash.com/photo-1550304943-4f24f54ddde9?auto=format&fit=crop&q=80&w=1000', active: true },
|
| 14 |
+
{ id: 's1', name: 'Sopa de Tomate', price: 7.00, category: 'Entradas', image: 'https://images.unsplash.com/photo-1547592166-23ac45744acd?auto=format&fit=crop&q=80&w=1000', active: true },
|
| 15 |
+
{ id: 'g1', name: 'Sandwich Gourmet', price: 11.00, category: 'Fuertes', image: 'https://images.unsplash.com/photo-1528735602780-2552fd46c7af?auto=format&fit=crop&q=80&w=1000', active: true },
|
| 16 |
+
{ id: 'm1', name: 'Chocolate Muffin', price: 4.50, category: 'Postres', image: 'https://images.unsplash.com/photo-1582231222779-1adb0b322f84?auto=format&fit=crop&q=80&w=1000', active: true },
|
| 17 |
+
{ id: 'sp1', name: 'Ribeye Premium', price: 35.00, category: 'Especialidades', image: '/images/steak.png', active: true },
|
| 18 |
+
{ id: 'sp2', name: 'Risotto de Trufa', price: 28.00, category: 'Especialidades', image: '/images/risotto.png', active: true },
|
| 19 |
+
{ id: 'sp3', name: 'Salmón Glaseado', price: 26.00, category: 'Especialidades', image: 'https://images.unsplash.com/photo-1467003909585-2f8a72700288?auto=format&fit=crop&q=80&w=1000', active: true },
|
| 20 |
+
{ id: 'sp4', name: 'Pato a la Naranja', price: 32.00, category: 'Especialidades', image: 'https://images.unsplash.com/photo-1626082927389-6cd097cdc6ec?auto=format&fit=crop&q=80&w=1000', active: true },
|
| 21 |
+
{ id: 'sp5', name: 'Langosta Thermidor', price: 45.00, category: 'Especialidades', image: 'https://images.unsplash.com/photo-1553243599-c052f82958d2?auto=format&fit=crop&q=80&w=1000', active: true }
|
| 22 |
+
];
|
| 23 |
+
|
| 24 |
+
const [menuItems, setMenuItems] = useState(defaultItems);
|
| 25 |
+
const [categories, setCategories] = useState(['Todos', 'Entradas', 'Fuertes', 'Pizzas', 'Pasta', 'Postres', 'Especialidades']);
|
| 26 |
const [activeCategory, setActiveCategory] = useState('Todos');
|
| 27 |
+
const [menuTheme, setMenuTheme] = useState('light');
|
| 28 |
const [feedback, setFeedback] = useState({ rating: 5, comment: '' });
|
| 29 |
const [submitted, setSubmitted] = useState(false);
|
| 30 |
const [cartCount, setCartCount] = useState(0);
|
|
|
|
| 53 |
: menuItems.filter(item => item.category === activeCategory);
|
| 54 |
|
| 55 |
const isDark = menuTheme === 'dark';
|
| 56 |
+
// Forzamos modo claro si el usuario lo pidió
|
| 57 |
const forceLight = true;
|
| 58 |
|
| 59 |
const themeColors = {
|