Implementa revisao de adjudicacoes e navegacao partilhada do SGC
This commit is contained in:
@@ -1,14 +1,11 @@
|
||||
import { Head, Link, router } from '@inertiajs/react';
|
||||
import { Head, router } from '@inertiajs/react';
|
||||
import { useState } from 'react';
|
||||
import {
|
||||
ArrowRight,
|
||||
Building2,
|
||||
ClipboardList,
|
||||
Eye,
|
||||
FileText,
|
||||
LayoutGrid,
|
||||
LockKeyhole,
|
||||
Menu,
|
||||
Palette,
|
||||
Scale,
|
||||
Search,
|
||||
@@ -126,17 +123,7 @@ const navigation = [
|
||||
{ id: 'appearance', title: 'Cores e componentes', icon: Palette },
|
||||
];
|
||||
type Detail = { title: string; subtitle: string; rows: [string, string][] };
|
||||
const navigationGroups = [
|
||||
{ title: 'Geral', ids: ['overview'] },
|
||||
{ title: 'Compras', ids: ['requests', 'suppliers', 'quotes', 'orders'] },
|
||||
{ title: 'Armazém', ids: ['receipts', 'stock', 'operations', 'equipment'] },
|
||||
{ title: 'Controlo', ids: ['conflicts'] },
|
||||
{
|
||||
title: 'Finanças',
|
||||
ids: ['invoices', 'bank', 'payments', 'reinforcements', 'investment'],
|
||||
},
|
||||
{ title: 'Apresentação', ids: ['appearance'] },
|
||||
];
|
||||
|
||||
export default function Preview({
|
||||
initialScreen = 'overview',
|
||||
}: {
|
||||
@@ -144,12 +131,12 @@ export default function Preview({
|
||||
}) {
|
||||
const screen = initialScreen;
|
||||
const [search, setSearch] = useState('');
|
||||
const [menu, setMenu] = useState(false);
|
||||
|
||||
const [detail, setDetail] = useState<Detail | null>(null);
|
||||
const title = navigation.find((n) => n.id === screen)?.title ?? 'Consulta';
|
||||
function navigate(id: string) {
|
||||
setSearch('');
|
||||
setMenu(false);
|
||||
|
||||
router.get(previewPaths[id] ?? '/consulta');
|
||||
}
|
||||
const filteredRequests = requests.filter((r) =>
|
||||
@@ -231,96 +218,11 @@ export default function Preview({
|
||||
<>
|
||||
<Head title="Consulta livre" />
|
||||
<div className="min-h-screen bg-muted/25 text-foreground">
|
||||
<aside
|
||||
className={`${menu ? 'flex' : 'hidden'} fixed inset-y-0 left-0 z-30 w-64 flex-col border-r bg-background p-5 lg:flex`}
|
||||
>
|
||||
<Link
|
||||
href="/"
|
||||
className="mb-8 flex items-center gap-3 text-xl font-semibold"
|
||||
>
|
||||
<span className="grid size-9 place-items-center rounded-xl bg-teal-700 text-sm text-white">
|
||||
SGC
|
||||
</span>
|
||||
SGC
|
||||
</Link>
|
||||
<div className="mb-7 rounded-xl border bg-muted/30 p-4">
|
||||
<p className="flex items-center gap-2 text-sm font-semibold">
|
||||
<Building2 className="size-4" />
|
||||
Empresa de demonstração
|
||||
</p>
|
||||
<p className="mt-2 text-xs text-muted-foreground">
|
||||
Consulta livre · sem autenticação
|
||||
</p>
|
||||
<div>
|
||||
<div className="mx-auto max-w-7xl px-5 pt-5 text-sm text-muted-foreground">
|
||||
Consulta / {title}
|
||||
</div>
|
||||
<nav
|
||||
aria-label="Áreas da demonstração"
|
||||
className="space-y-4"
|
||||
>
|
||||
{navigationGroups.map((group) => (
|
||||
<div key={group.title}>
|
||||
<p className="mb-1 px-3 text-[10px] font-semibold tracking-widest text-muted-foreground uppercase">
|
||||
{group.title}
|
||||
</p>
|
||||
{navigation
|
||||
.filter((n) => group.ids.includes(n.id))
|
||||
.map((n) => (
|
||||
<Link
|
||||
href={previewPaths[n.id]}
|
||||
key={n.id}
|
||||
onClick={() => setMenu(false)}
|
||||
aria-current={
|
||||
screen === n.id
|
||||
? 'page'
|
||||
: undefined
|
||||
}
|
||||
className={`flex w-full items-center gap-3 rounded-lg px-3 py-3 text-left text-sm transition-colors ${screen === n.id ? 'bg-teal-50 font-medium text-teal-800 dark:bg-teal-950 dark:text-teal-200' : 'text-muted-foreground hover:bg-muted'}`}
|
||||
>
|
||||
<n.icon className="size-4" />
|
||||
{n.title}
|
||||
</Link>
|
||||
))}
|
||||
</div>
|
||||
))}
|
||||
</nav>
|
||||
<p className="mt-auto pt-8 text-xs leading-5 text-muted-foreground">
|
||||
Dados fictícios. A navegação e a pesquisa permitem
|
||||
avaliar a apresentação; não executam compras.
|
||||
</p>
|
||||
</aside>
|
||||
{menu && (
|
||||
<button
|
||||
className="fixed inset-0 z-20 bg-black/25 lg:hidden"
|
||||
aria-label="Fechar menu"
|
||||
onClick={() => setMenu(false)}
|
||||
/>
|
||||
)}
|
||||
<div className="lg:ml-64">
|
||||
<header className="flex min-h-20 items-center justify-between gap-3 border-b bg-background px-5 lg:px-8">
|
||||
<div className="flex items-center gap-3">
|
||||
<Button
|
||||
variant="ghost"
|
||||
size="icon"
|
||||
className="lg:hidden"
|
||||
aria-label="Abrir menu"
|
||||
onClick={() => setMenu(!menu)}
|
||||
>
|
||||
<Menu className="size-5" />
|
||||
</Button>
|
||||
<span className="text-sm text-muted-foreground">
|
||||
Consulta visual <span className="mx-2">/</span>
|
||||
<strong className="font-medium text-foreground">
|
||||
{title}
|
||||
</strong>
|
||||
</span>
|
||||
</div>
|
||||
<Button asChild variant="outline">
|
||||
<Link href="/login">
|
||||
<LockKeyhole className="size-4" />
|
||||
Entrar na empresa
|
||||
</Link>
|
||||
</Button>
|
||||
</header>
|
||||
<main className="mx-auto flex max-w-7xl flex-col gap-6 p-5 lg:p-8">
|
||||
<div className="mx-auto flex max-w-7xl flex-col gap-6 p-5 lg:p-8">
|
||||
<div className="flex flex-wrap items-center justify-between gap-2 rounded-lg border border-teal-200 bg-teal-50 px-4 py-3 text-sm text-teal-900 dark:border-teal-900 dark:bg-teal-950 dark:text-teal-100">
|
||||
<span className="flex items-center gap-2">
|
||||
<Eye className="size-4" />
|
||||
@@ -932,11 +834,7 @@ export default function Preview({
|
||||
</Panel>
|
||||
</>
|
||||
)}
|
||||
<footer className="py-4 text-xs text-muted-foreground">
|
||||
SGC · Consulta pública de exemplos · Os processos
|
||||
reais permanecem no acesso autenticado.
|
||||
</footer>
|
||||
</main>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<Dialog
|
||||
|
||||
Reference in New Issue
Block a user