From f491500c1805c8ad016358bb1d840b665bf16975 Mon Sep 17 00:00:00 2001 From: Anna Date: Sat, 2 Nov 2024 01:19:58 +0100 Subject: [PATCH] feat : backend : SSE mealSlectionForPayments but graphical interface to change --- apps/frontend-common-space/src/app/app.tsx | 2 +- .../lib/commandsR/mealSelectionForPayment.tsx | 79 +++++++++++++++++-- 2 files changed, 73 insertions(+), 8 deletions(-) diff --git a/apps/frontend-common-space/src/app/app.tsx b/apps/frontend-common-space/src/app/app.tsx index 4fc4d7f..89eb91b 100644 --- a/apps/frontend-common-space/src/app/app.tsx +++ b/apps/frontend-common-space/src/app/app.tsx @@ -37,7 +37,7 @@ export function App() { /> } /> } /> diff --git a/libs/ui/common/src/lib/commandsR/mealSelectionForPayment.tsx b/libs/ui/common/src/lib/commandsR/mealSelectionForPayment.tsx index 3caa3a6..a499729 100644 --- a/libs/ui/common/src/lib/commandsR/mealSelectionForPayment.tsx +++ b/libs/ui/common/src/lib/commandsR/mealSelectionForPayment.tsx @@ -1,8 +1,37 @@ import React from 'react'; import Footer from '../utils/mealSelectionForPaymentFooter'; import BackButton from '../utils/backButton'; +import { CatalogDisplay } from './catalogDisplay'; +import { useSSE, SSEProvider } from 'react-hooks-sse'; +import { useParams } from 'react-router-dom'; +import { Box, Typography } from '@mui/material'; +import { parse } from 'path'; + +interface MealSelectionContentProps { + onClose: () => void; + onSelectWhoPays: () => void; + onGroupClick: () => void; + onBackButtonClick: () => void; + tableNumber: number; +} +interface TableItem { + number: number; + elements: { + item: { + name: string; + price: number; + }; + remaining: number; + onTable: number; + }[]; +} export function MealSelectionForPayment() { + const { groupId, tableNumber } = useParams<{ + groupId: string; + tableNumber: string; + }>(); + function handleClose() { console.log('Close button clicked'); } @@ -15,21 +44,57 @@ export function MealSelectionForPayment() { console.log('Group button clicked'); } - function handdleBackButtonClick(): void { + function handleBackButtonClick(): void { console.log('Back button clicked'); } return ( -
- handdleBackButtonClick()} - - /> -