// Main app — menu list in an iOS frame, tap an item to open the drawer
const { IOSDevice } = window;
const { MENU, DIAVOLA, OrderDrawer } = window;
function MenuItemRow({ item, onTap, badge }) {
const [pressed, setPressed] = React.useState(false);
return (
);
}
function App() {
const [drawerOpen, setDrawerOpen] = React.useState(true); // open by default so the design is immediately visible
const [orderCounts, setOrderCounts] = React.useState({ margherita: 2, coke: 1 });
// Tapping a menu item: for this demo only Diavola has a full spec,
// so we always feed the drawer the Diavola config but show the tap behavior.
const openDrawer = (_item) => setDrawerOpen(true);
const closeDrawer = () => setDrawerOpen(false);
const handleAdd = ({ product, qty }) => {
setOrderCounts(prev => ({ ...prev, [product.id]: (prev[product.id] || 0) + qty }));
setDrawerOpen(false);
};
return (