Atalho Nova requisição só no contexto de Compras, como o menu

This commit is contained in:
2026-12-02 13:59:29 +02:00
parent 1d76b6c588
commit 9a57bb1ac6
4 changed files with 95 additions and 14 deletions
+17 -12
View File
@@ -36,6 +36,7 @@ import type {
import { roleLabels } from '@/types/procurement';
import type { WorkContextState } from '@/types/work-context';
import { WorkContextChange } from '@/components/work-context-change';
import { contextOffersPath } from '@/lib/work-context-paths';
import { ProcurementMenuResults } from '@/components/procurement-menu-results';
import {
matchesMenuSearch,
@@ -559,18 +560,22 @@ export function SgcWorkspaceShell({ children }: { children: ReactNode }) {
<Link href="/login">Entrar</Link>
</Button>
)}
{page.props.canRequest === true && (
<Button
asChild
size="sm"
className="hidden bg-[#ed1c24] text-white hover:bg-[#d01720] sm:inline-flex"
>
<Link href="/requisicoes/criar">
<Plus className="size-4" />
Nova requisição
</Link>
</Button>
)}
{page.props.canRequest === true &&
contextOffersPath(
context,
'/requisicoes/criar',
) && (
<Button
asChild
size="sm"
className="hidden bg-[#ed1c24] text-white hover:bg-[#d01720] sm:inline-flex"
>
<Link href="/requisicoes/criar">
<Plus className="size-4" />
Nova requisição
</Link>
</Button>
)}
{user && (
<DropdownMenu>
<DropdownMenuTrigger asChild>