+
Guest View
- {!showQr ? (
-
- ) : (
-
- {person && (
- <>
-
{person.name}
-
-
+ {!showQr ? (
+
+
+
+ Enter Your QR Code
+ setQrCode(e.target.value)}
+ placeholder="Your QR code (GUID)"
+ required
+ />
+
+
+
+
+
+ ) : (
+
+
+ {person && (
+ <>
+ {person.name}
- Your Quotas
-
- {person.quotas?.map((quota) => (
-
-
-
-
{quota.productName}
-
{quota.productType}
-
-
-
{quota.remainingAmount}
-
of {quota.initialAmount} remaining
-
-
-
-
- >
- )}
-
- )}
+
Your Quotas
+
+ {person.quotas?.map((quota) => (
+
+
+
+
{quota.productName}
+ {quota.productType}
+
+
+
{quota.remainingAmount}
+ of {quota.initialAmount} remaining
+
+
+
+
+ ))}
+
+
+
+ >
+ )}
+
+
+ )}
+
);
}
diff --git a/src/hospitality-web/src/pages/staff/ScannerPage.tsx b/src/hospitality-web/src/pages/staff/ScannerPage.tsx
index 8fc6a2e..c903822 100644
--- a/src/hospitality-web/src/pages/staff/ScannerPage.tsx
+++ b/src/hospitality-web/src/pages/staff/ScannerPage.tsx
@@ -1,101 +1,116 @@
import { useState } from 'react';
+import { Card, Form, Button, Badge, ListGroup, Alert } from 'react-bootstrap';
import { usePersonByQrCode, useCreateTransaction } from '../../hooks/useQrCode';
export default function ScannerPage() {
const [qrCode, setQrCode] = useState('');
- const [selectedProduct, setSelectedProduct] = useState('');
- const { data: person, isLoading } = usePersonByQrCode(qrCode);
+ const [searchQr, setSearchQr] = useState('');
+ const { data: person, isLoading } = usePersonByQrCode(searchQr);
const createTransaction = useCreateTransaction();
const handleScan = (e: React.FormEvent) => {
e.preventDefault();
- // QR code is set, person data will load automatically
+ setSearchQr(qrCode);
};
const handleTransaction = async (productId: string, amount: number) => {
try {
await createTransaction.mutateAsync({
- qrCode,
+ qrCode: searchQr,
productId,
amount,
});
- alert('Transaction recorded!');
+ alert('Transaction recorded successfully!');
} catch (error: any) {
alert(error.response?.data || 'Failed to record transaction');
}
};
return (
-
-
Staff Scanner
+
+
+
Staff Scanner
-
);
}
diff --git a/src/hospitality-web/tailwind.config.js b/src/hospitality-web/tailwind.config.js
deleted file mode 100644
index dca8ba0..0000000
--- a/src/hospitality-web/tailwind.config.js
+++ /dev/null
@@ -1,11 +0,0 @@
-/** @type {import('tailwindcss').Config} */
-export default {
- content: [
- "./index.html",
- "./src/**/*.{js,ts,jsx,tsx}",
- ],
- theme: {
- extend: {},
- },
- plugins: [],
-}