Atalho Nova requisição só no contexto de Compras, como o menu
This commit is contained in:
@@ -9,8 +9,10 @@ import {
|
||||
} from 'lucide-react';
|
||||
import { PageTitle, Panel, RequisitionTable } from '@/components/procurement';
|
||||
import { Button } from '@/components/ui/button';
|
||||
import { contextOffersPath } from '@/lib/work-context-paths';
|
||||
import { money } from '@/types/procurement';
|
||||
import type { Company, Requisition } from '@/types/procurement';
|
||||
import type { WorkContextState } from '@/types/work-context';
|
||||
|
||||
type Props = {
|
||||
company: Company | null;
|
||||
@@ -30,8 +32,14 @@ export default function Dashboard({
|
||||
recent,
|
||||
approvals,
|
||||
}: Props) {
|
||||
const canRequest = usePage().props.canRequest === true;
|
||||
const publicNavigation = !!usePage().props.publicNavigation;
|
||||
const { props } = usePage();
|
||||
const canRequest =
|
||||
props.canRequest === true &&
|
||||
contextOffersPath(
|
||||
props.workContext as WorkContextState | null | undefined,
|
||||
'/requisicoes/criar',
|
||||
);
|
||||
const publicNavigation = !!props.publicNavigation;
|
||||
const cards = [
|
||||
{
|
||||
label: 'Requisições',
|
||||
|
||||
Reference in New Issue
Block a user