Standalone register at /pos bypassing the admin sidebar layout: - Two-panel layout: product search/grid (60%) + cart/payment (40%) - Product search with barcode scan support (UPC lookup on Enter) - Custom item entry dialog for ad-hoc items - Cart with line items, tax, totals, and remove-item support - Payment dialogs: cash (quick amounts + change calc), card, check - Drawer open/close with balance reconciliation and over/short - Auto-creates pending transaction on first item added - POS link added to admin sidebar nav (module-gated) - Zustand store for POS session state, React Query for server data Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
22 lines
545 B
TypeScript
22 lines
545 B
TypeScript
import { createFileRoute, redirect } from '@tanstack/react-router'
|
|
import { useAuthStore } from '@/stores/auth.store'
|
|
import { POSRegister } from '@/components/pos/pos-register'
|
|
|
|
export const Route = createFileRoute('/pos')({
|
|
beforeLoad: () => {
|
|
const { token } = useAuthStore.getState()
|
|
if (!token) {
|
|
throw redirect({ to: '/login' })
|
|
}
|
|
},
|
|
component: POSPage,
|
|
})
|
|
|
|
function POSPage() {
|
|
return (
|
|
<div className="h-screen w-screen overflow-hidden bg-background text-foreground">
|
|
<POSRegister />
|
|
</div>
|
|
)
|
|
}
|