feat(POS-006): completed feature
This commit is contained in:
33
project/apps/pos/src/app/(terminal)/page.tsx
Normal file
33
project/apps/pos/src/app/(terminal)/page.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
'use client';
|
||||
import { useEffect, useState } from 'react';
|
||||
import { posApi } from '@/lib/api-client';
|
||||
|
||||
export default function TerminalPage() {
|
||||
const [status, setStatus] = useState<'loading' | 'bound' | 'no-session'>('loading');
|
||||
|
||||
useEffect(() => {
|
||||
posApi.me()
|
||||
.then(() => setStatus('bound'))
|
||||
.catch(() => setStatus('no-session'));
|
||||
}, []);
|
||||
|
||||
if (status === 'loading') {
|
||||
return <div className="flex items-center justify-center min-h-screen text-gray-500">Cargando TPV…</div>;
|
||||
}
|
||||
|
||||
if (status === 'no-session') {
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center min-h-screen p-8 text-center">
|
||||
<h1 className="text-3xl font-bold mb-4" style={{ color: 'var(--color-primary)' }}>TPV sin vincular</h1>
|
||||
<p className="text-gray-500 mb-6">Usa un código de vinculación desde la admin para activar este terminal.</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="flex flex-col items-center justify-center min-h-screen text-center">
|
||||
<h1 className="text-4xl font-bold mb-4" style={{ color: 'var(--color-primary)' }}>Mercado de Vida</h1>
|
||||
<p className="text-gray-500">TPV listo. Implementa la pantalla de venta en POS-007.</p>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user