2026-03-11 23:33:10 +00:00
|
|
|
<script setup lang="ts">
|
|
|
|
|
import { Head, Link } from '@inertiajs/vue3';
|
|
|
|
|
import {
|
|
|
|
|
Briefcase,
|
|
|
|
|
Building2,
|
|
|
|
|
Users,
|
|
|
|
|
FolderOpen,
|
|
|
|
|
AlertTriangle,
|
|
|
|
|
Clock,
|
|
|
|
|
FileCheck,
|
|
|
|
|
MessageSquareWarning,
|
|
|
|
|
ArrowRight,
|
2026-03-12 18:25:32 +00:00
|
|
|
FileStack,
|
2026-03-11 23:33:10 +00:00
|
|
|
} from 'lucide-vue-next';
|
2026-03-12 18:25:32 +00:00
|
|
|
import { computed } from 'vue';
|
|
|
|
|
import PlaceholderPattern from '@/components/PlaceholderPattern.vue';
|
2026-03-11 23:33:10 +00:00
|
|
|
import { Badge } from '@/components/ui/badge';
|
2026-03-12 18:25:32 +00:00
|
|
|
import { Button } from '@/components/ui/button';
|
2026-03-11 23:33:10 +00:00
|
|
|
import { Card, CardContent, CardHeader, CardTitle } from '@/components/ui/card';
|
2026-03-12 18:25:32 +00:00
|
|
|
import AppLayout from '@/layouts/AppLayout.vue';
|
2026-03-11 23:33:10 +00:00
|
|
|
import { dashboard } from '@/routes';
|
2026-03-12 18:25:32 +00:00
|
|
|
import type { BreadcrumbItem } from '@/types';
|
2026-03-11 23:33:10 +00:00
|
|
|
|
2026-03-12 18:25:32 +00:00
|
|
|
type AssignedDeclaration = {
|
2026-03-11 23:33:10 +00:00
|
|
|
id: number;
|
|
|
|
|
title: string;
|
|
|
|
|
type: string;
|
|
|
|
|
client_name: string;
|
|
|
|
|
status: string;
|
|
|
|
|
due_date: string | null;
|
|
|
|
|
priority: string | null;
|
|
|
|
|
showUrl: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
type NotificationItem = {
|
|
|
|
|
id: number;
|
|
|
|
|
title: string;
|
|
|
|
|
client_name: string;
|
|
|
|
|
due_date?: string;
|
|
|
|
|
showUrl: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
type Props = {
|
2026-03-12 18:25:32 +00:00
|
|
|
assignedDeclarations: AssignedDeclaration[];
|
2026-03-11 23:33:10 +00:00
|
|
|
notifications: {
|
|
|
|
|
overdue: NotificationItem[];
|
|
|
|
|
due_soon: NotificationItem[];
|
|
|
|
|
documents_received: NotificationItem[];
|
|
|
|
|
awaiting_validation: NotificationItem[];
|
|
|
|
|
};
|
|
|
|
|
workspaceName: string | null;
|
2026-03-12 18:25:32 +00:00
|
|
|
declarationsUrl: string | null;
|
2026-03-11 23:33:10 +00:00
|
|
|
clientsUrl: string | null;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const props = defineProps<Props>();
|
|
|
|
|
|
|
|
|
|
const breadcrumbs: BreadcrumbItem[] = [
|
|
|
|
|
{
|
|
|
|
|
title: 'Dashboard',
|
|
|
|
|
href: dashboard().url,
|
|
|
|
|
},
|
|
|
|
|
];
|
|
|
|
|
|
|
|
|
|
const hasWorkspace = computed(() => !!props.workspaceName);
|
|
|
|
|
|
|
|
|
|
const typeLabels: Record<string, string> = {
|
|
|
|
|
vat: 'TVA',
|
|
|
|
|
vat_monthly: 'TVA mensuelle',
|
|
|
|
|
vat_quarterly: 'TVA trimestrielle',
|
|
|
|
|
corporate_tax: 'IS',
|
|
|
|
|
income_tax: 'IR',
|
|
|
|
|
cnss: 'CNSS',
|
|
|
|
|
annual_balance: 'Bilan',
|
|
|
|
|
other: 'Autre',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const statusLabels: Record<string, string> = {
|
|
|
|
|
draft: 'Brouillon',
|
|
|
|
|
waiting_documents: 'En attente documents',
|
|
|
|
|
documents_received: 'Documents reçus',
|
|
|
|
|
processing: 'En cours',
|
|
|
|
|
additional_documents_requested: 'Pièces complémentaires',
|
|
|
|
|
waiting_client_validation: 'En attente validation',
|
|
|
|
|
validated: 'Validé',
|
|
|
|
|
closed: 'Clôturé',
|
|
|
|
|
cancelled: 'Annulé',
|
|
|
|
|
};
|
|
|
|
|
|
2026-03-12 18:25:32 +00:00
|
|
|
const statusVariant: Record<
|
|
|
|
|
string,
|
|
|
|
|
'default' | 'secondary' | 'destructive' | 'outline'
|
|
|
|
|
> = {
|
2026-03-11 23:33:10 +00:00
|
|
|
draft: 'secondary',
|
|
|
|
|
waiting_documents: 'outline',
|
|
|
|
|
documents_received: 'default',
|
|
|
|
|
processing: 'default',
|
|
|
|
|
additional_documents_requested: 'default',
|
|
|
|
|
waiting_client_validation: 'outline',
|
|
|
|
|
validated: 'secondary',
|
|
|
|
|
closed: 'secondary',
|
|
|
|
|
cancelled: 'secondary',
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
function statusLabel(s: string): string {
|
|
|
|
|
return statusLabels[s] ?? s;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function typeLabel(t: string): string {
|
|
|
|
|
return typeLabels[t] ?? t;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
function progressPercent(status: string): number {
|
|
|
|
|
const steps: Record<string, number> = {
|
|
|
|
|
draft: 0,
|
|
|
|
|
waiting_documents: 10,
|
|
|
|
|
documents_received: 30,
|
|
|
|
|
processing: 50,
|
|
|
|
|
additional_documents_requested: 45,
|
|
|
|
|
waiting_client_validation: 80,
|
|
|
|
|
validated: 100,
|
|
|
|
|
closed: 100,
|
|
|
|
|
cancelled: 0,
|
|
|
|
|
};
|
|
|
|
|
return steps[status] ?? 50;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const hasAnyNotifications = computed(
|
|
|
|
|
() =>
|
|
|
|
|
props.notifications.overdue.length > 0 ||
|
|
|
|
|
props.notifications.due_soon.length > 0 ||
|
|
|
|
|
props.notifications.documents_received.length > 0 ||
|
|
|
|
|
props.notifications.awaiting_validation.length > 0,
|
|
|
|
|
);
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<template>
|
|
|
|
|
<Head title="Dashboard" />
|
|
|
|
|
|
|
|
|
|
<AppLayout :breadcrumbs="breadcrumbs">
|
2026-03-12 18:25:32 +00:00
|
|
|
<div
|
|
|
|
|
class="flex h-full flex-1 flex-col gap-6 overflow-x-auto rounded-xl p-4"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<!-- Quick links when no workspace -->
|
2026-03-12 18:25:32 +00:00
|
|
|
<div
|
|
|
|
|
v-if="!hasWorkspace"
|
|
|
|
|
class="grid auto-rows-min gap-4 md:grid-cols-3"
|
|
|
|
|
>
|
|
|
|
|
<Link
|
|
|
|
|
href="/users"
|
|
|
|
|
class="relative flex aspect-video flex-col items-center justify-center gap-2 overflow-hidden rounded-xl border border-sidebar-border/70 transition-colors hover:bg-muted/50 dark:border-sidebar-border"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<Users class="h-8 w-8" />
|
|
|
|
|
<span class="font-medium">Users</span>
|
2026-03-12 18:25:32 +00:00
|
|
|
<span class="text-xs text-muted-foreground"
|
|
|
|
|
>Manage users</span
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
</Link>
|
2026-03-12 18:25:32 +00:00
|
|
|
<Link
|
|
|
|
|
href="/workspaces"
|
|
|
|
|
class="relative flex aspect-video flex-col items-center justify-center gap-2 overflow-hidden rounded-xl border border-sidebar-border/70 transition-colors hover:bg-muted/50 dark:border-sidebar-border"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<Building2 class="h-8 w-8" />
|
|
|
|
|
<span class="font-medium">Workspaces</span>
|
2026-03-12 18:25:32 +00:00
|
|
|
<span class="text-xs text-muted-foreground"
|
|
|
|
|
>Cabinets comptables</span
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
</Link>
|
2026-03-12 18:25:32 +00:00
|
|
|
<Link
|
|
|
|
|
v-if="clientsUrl"
|
|
|
|
|
:href="clientsUrl"
|
|
|
|
|
class="relative flex aspect-video flex-col items-center justify-center gap-2 overflow-hidden rounded-xl border border-sidebar-border/70 transition-colors hover:bg-muted/50 dark:border-sidebar-border"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<Briefcase class="h-8 w-8" />
|
|
|
|
|
<span class="font-medium">Clients</span>
|
2026-03-12 18:25:32 +00:00
|
|
|
<span class="text-xs text-muted-foreground"
|
|
|
|
|
>Manage clients</span
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
</Link>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-03-12 18:25:32 +00:00
|
|
|
<div
|
|
|
|
|
v-if="hasWorkspace"
|
|
|
|
|
class="grid auto-rows-min gap-4 md:grid-cols-3"
|
|
|
|
|
>
|
|
|
|
|
<Link
|
|
|
|
|
v-if="declarationsUrl"
|
|
|
|
|
:href="declarationsUrl"
|
|
|
|
|
class="relative flex aspect-video flex-col items-center justify-center gap-2 overflow-hidden rounded-xl border border-sidebar-border/70 transition-colors hover:bg-muted/50 dark:border-sidebar-border"
|
|
|
|
|
>
|
|
|
|
|
<FileStack class="h-8 w-8" />
|
|
|
|
|
<span class="font-medium">Déclarations</span>
|
|
|
|
|
<span class="text-xs text-muted-foreground"
|
|
|
|
|
>Gérer les déclarations</span
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
</Link>
|
2026-03-12 18:25:32 +00:00
|
|
|
<Link
|
|
|
|
|
v-if="clientsUrl"
|
|
|
|
|
:href="clientsUrl"
|
|
|
|
|
class="relative flex aspect-video flex-col items-center justify-center gap-2 overflow-hidden rounded-xl border border-sidebar-border/70 transition-colors hover:bg-muted/50 dark:border-sidebar-border"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<Briefcase class="h-8 w-8" />
|
|
|
|
|
<span class="font-medium">Clients</span>
|
2026-03-12 18:25:32 +00:00
|
|
|
<span class="text-xs text-muted-foreground"
|
|
|
|
|
>Manage clients</span
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
</Link>
|
|
|
|
|
<div
|
|
|
|
|
class="relative aspect-video overflow-hidden rounded-xl border border-sidebar-border/70 dark:border-sidebar-border"
|
|
|
|
|
>
|
|
|
|
|
<PlaceholderPattern />
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<!-- Workspace dashboard -->
|
|
|
|
|
<template v-if="hasWorkspace">
|
|
|
|
|
<!-- Notifications -->
|
|
|
|
|
<div v-if="hasAnyNotifications" class="space-y-4">
|
|
|
|
|
<h2 class="text-lg font-semibold">À traiter</h2>
|
|
|
|
|
<div class="grid gap-4 md:grid-cols-2 lg:grid-cols-4">
|
2026-03-12 18:25:32 +00:00
|
|
|
<Card
|
|
|
|
|
v-if="notifications.overdue.length > 0"
|
|
|
|
|
class="border-destructive/50 bg-destructive/5"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<CardHeader class="pb-2">
|
2026-03-12 18:25:32 +00:00
|
|
|
<CardTitle
|
|
|
|
|
class="flex items-center gap-2 text-base"
|
|
|
|
|
>
|
|
|
|
|
<AlertTriangle
|
|
|
|
|
class="h-4 w-4 text-destructive"
|
|
|
|
|
/>
|
2026-03-11 23:33:10 +00:00
|
|
|
En retard
|
|
|
|
|
</CardTitle>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent class="space-y-2">
|
2026-03-12 18:25:32 +00:00
|
|
|
<Link
|
|
|
|
|
v-for="item in notifications.overdue"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:href="item.showUrl"
|
|
|
|
|
class="flex items-center justify-between rounded-md p-2 text-sm transition-colors hover:bg-muted/50"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<div class="truncate">
|
|
|
|
|
<span class="font-medium">{{
|
|
|
|
|
item.title
|
2026-03-12 18:25:32 +00:00
|
|
|
}}</span>
|
|
|
|
|
<span
|
|
|
|
|
class="ml-1 text-muted-foreground"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
{{ item.client_name }}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<ArrowRight class="h-4 w-4 shrink-0" />
|
|
|
|
|
</Link>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
2026-03-12 18:25:32 +00:00
|
|
|
<Card
|
|
|
|
|
v-if="notifications.due_soon.length > 0"
|
|
|
|
|
class="border-amber-500/50 bg-amber-500/5"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<CardHeader class="pb-2">
|
2026-03-12 18:25:32 +00:00
|
|
|
<CardTitle
|
|
|
|
|
class="flex items-center gap-2 text-base"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<Clock class="h-4 w-4 text-amber-600" />
|
|
|
|
|
Échéance proche
|
|
|
|
|
</CardTitle>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent class="space-y-2">
|
2026-03-12 18:25:32 +00:00
|
|
|
<Link
|
|
|
|
|
v-for="item in notifications.due_soon"
|
|
|
|
|
:key="item.id"
|
|
|
|
|
:href="item.showUrl"
|
|
|
|
|
class="flex items-center justify-between rounded-md p-2 text-sm transition-colors hover:bg-muted/50"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<div class="truncate">
|
|
|
|
|
<span class="font-medium">{{
|
|
|
|
|
item.title
|
2026-03-12 18:25:32 +00:00
|
|
|
}}</span>
|
|
|
|
|
<span
|
|
|
|
|
class="ml-1 text-muted-foreground"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
{{ item.client_name }} —
|
|
|
|
|
{{ item.due_date }}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<ArrowRight class="h-4 w-4 shrink-0" />
|
|
|
|
|
</Link>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
2026-03-12 18:25:32 +00:00
|
|
|
<Card
|
|
|
|
|
v-if="notifications.documents_received.length > 0"
|
|
|
|
|
class="border-primary/50 bg-primary/5"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<CardHeader class="pb-2">
|
2026-03-12 18:25:32 +00:00
|
|
|
<CardTitle
|
|
|
|
|
class="flex items-center gap-2 text-base"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<FileCheck class="h-4 w-4 text-primary" />
|
|
|
|
|
Documents reçus
|
|
|
|
|
</CardTitle>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent class="space-y-2">
|
2026-03-12 18:25:32 +00:00
|
|
|
<Link
|
|
|
|
|
v-for="item in notifications.documents_received"
|
|
|
|
|
:key="item.id"
|
2026-03-11 23:33:10 +00:00
|
|
|
:href="item.showUrl"
|
2026-03-12 18:25:32 +00:00
|
|
|
class="flex items-center justify-between rounded-md p-2 text-sm transition-colors hover:bg-muted/50"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<div class="truncate">
|
|
|
|
|
<span class="font-medium">{{
|
|
|
|
|
item.title
|
2026-03-12 18:25:32 +00:00
|
|
|
}}</span>
|
|
|
|
|
<span
|
|
|
|
|
class="ml-1 text-muted-foreground"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
{{ item.client_name }}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<ArrowRight class="h-4 w-4 shrink-0" />
|
|
|
|
|
</Link>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
2026-03-12 18:25:32 +00:00
|
|
|
<Card
|
|
|
|
|
v-if="notifications.awaiting_validation.length > 0"
|
|
|
|
|
class="border-blue-500/50 bg-blue-500/5"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<CardHeader class="pb-2">
|
2026-03-12 18:25:32 +00:00
|
|
|
<CardTitle
|
|
|
|
|
class="flex items-center gap-2 text-base"
|
|
|
|
|
>
|
|
|
|
|
<MessageSquareWarning
|
|
|
|
|
class="h-4 w-4 text-blue-600"
|
|
|
|
|
/>
|
2026-03-11 23:33:10 +00:00
|
|
|
En attente validation client
|
|
|
|
|
</CardTitle>
|
|
|
|
|
</CardHeader>
|
|
|
|
|
<CardContent class="space-y-2">
|
2026-03-12 18:25:32 +00:00
|
|
|
<Link
|
|
|
|
|
v-for="item in notifications.awaiting_validation"
|
|
|
|
|
:key="item.id"
|
2026-03-11 23:33:10 +00:00
|
|
|
:href="item.showUrl"
|
2026-03-12 18:25:32 +00:00
|
|
|
class="flex items-center justify-between rounded-md p-2 text-sm transition-colors hover:bg-muted/50"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<div class="truncate">
|
|
|
|
|
<span class="font-medium">{{
|
|
|
|
|
item.title
|
2026-03-12 18:25:32 +00:00
|
|
|
}}</span>
|
|
|
|
|
<span
|
|
|
|
|
class="ml-1 text-muted-foreground"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
{{ item.client_name }}
|
|
|
|
|
</span>
|
|
|
|
|
</div>
|
|
|
|
|
<ArrowRight class="h-4 w-4 shrink-0" />
|
|
|
|
|
</Link>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-03-12 18:25:32 +00:00
|
|
|
<!-- My assigned declarations -->
|
2026-03-11 23:33:10 +00:00
|
|
|
<div class="space-y-4">
|
|
|
|
|
<div class="flex items-center justify-between">
|
|
|
|
|
<h2 class="text-lg font-semibold">
|
2026-03-12 18:25:32 +00:00
|
|
|
Mes déclarations — {{ workspaceName }}
|
2026-03-11 23:33:10 +00:00
|
|
|
</h2>
|
2026-03-12 18:25:32 +00:00
|
|
|
<Button
|
|
|
|
|
v-if="declarationsUrl"
|
|
|
|
|
variant="outline"
|
|
|
|
|
as-child
|
|
|
|
|
>
|
|
|
|
|
<Link :href="declarationsUrl">
|
|
|
|
|
Toutes les déclarations
|
2026-03-11 23:33:10 +00:00
|
|
|
<ArrowRight class="ml-1 h-4 w-4" />
|
|
|
|
|
</Link>
|
|
|
|
|
</Button>
|
|
|
|
|
</div>
|
|
|
|
|
|
2026-03-12 18:25:32 +00:00
|
|
|
<Card
|
|
|
|
|
v-if="assignedDeclarations.length > 0"
|
|
|
|
|
class="overflow-hidden"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<div class="overflow-x-auto">
|
|
|
|
|
<table class="w-full text-sm">
|
2026-03-12 18:25:32 +00:00
|
|
|
<thead
|
|
|
|
|
class="border-b border-sidebar-border/70 bg-muted/50"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<tr>
|
2026-03-12 18:25:32 +00:00
|
|
|
<th
|
|
|
|
|
class="h-10 px-4 text-left font-medium"
|
|
|
|
|
>
|
|
|
|
|
Déclaration / Client
|
2026-03-11 23:33:10 +00:00
|
|
|
</th>
|
2026-03-12 18:25:32 +00:00
|
|
|
<th
|
|
|
|
|
class="h-10 px-4 text-left font-medium"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
Type
|
|
|
|
|
</th>
|
2026-03-12 18:25:32 +00:00
|
|
|
<th
|
|
|
|
|
class="h-10 px-4 text-left font-medium"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
Statut
|
|
|
|
|
</th>
|
2026-03-12 18:25:32 +00:00
|
|
|
<th
|
|
|
|
|
class="h-10 px-4 text-left font-medium"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
Progression
|
|
|
|
|
</th>
|
2026-03-12 18:25:32 +00:00
|
|
|
<th
|
|
|
|
|
class="h-10 px-4 text-left font-medium"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
Date limite
|
|
|
|
|
</th>
|
|
|
|
|
<th class="h-10 w-10 px-4"></th>
|
|
|
|
|
</tr>
|
|
|
|
|
</thead>
|
|
|
|
|
<tbody>
|
2026-03-12 18:25:32 +00:00
|
|
|
<tr
|
|
|
|
|
v-for="declaration in assignedDeclarations"
|
|
|
|
|
:key="declaration.id"
|
|
|
|
|
class="border-b border-sidebar-border/50 transition-colors last:border-0 hover:bg-muted/30"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
<td class="px-4 py-3">
|
2026-03-12 18:25:32 +00:00
|
|
|
<Link
|
|
|
|
|
:href="declaration.showUrl"
|
|
|
|
|
class="block font-medium hover:underline"
|
|
|
|
|
>
|
|
|
|
|
{{ declaration.title }}
|
2026-03-11 23:33:10 +00:00
|
|
|
</Link>
|
2026-03-12 18:25:32 +00:00
|
|
|
<span
|
|
|
|
|
class="block text-xs text-muted-foreground"
|
|
|
|
|
>
|
|
|
|
|
{{ declaration.client_name }}
|
2026-03-11 23:33:10 +00:00
|
|
|
</span>
|
|
|
|
|
</td>
|
2026-03-12 18:25:32 +00:00
|
|
|
<td
|
|
|
|
|
class="px-4 py-3 text-muted-foreground"
|
|
|
|
|
>
|
|
|
|
|
{{ typeLabel(declaration.type) }}
|
2026-03-11 23:33:10 +00:00
|
|
|
</td>
|
|
|
|
|
<td class="px-4 py-3">
|
2026-03-12 18:25:32 +00:00
|
|
|
<Badge
|
|
|
|
|
:variant="
|
|
|
|
|
statusVariant[
|
|
|
|
|
declaration.status
|
|
|
|
|
] ?? 'secondary'
|
|
|
|
|
"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
{{
|
2026-03-12 18:25:32 +00:00
|
|
|
statusLabel(
|
|
|
|
|
declaration.status,
|
|
|
|
|
)
|
2026-03-11 23:33:10 +00:00
|
|
|
}}
|
|
|
|
|
</Badge>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-4 py-3">
|
2026-03-12 18:25:32 +00:00
|
|
|
<div
|
|
|
|
|
class="flex h-2 w-24 overflow-hidden rounded-full bg-muted"
|
|
|
|
|
>
|
|
|
|
|
<div
|
|
|
|
|
class="h-full bg-primary transition-all"
|
|
|
|
|
:style="{
|
|
|
|
|
width: `${progressPercent(declaration.status)}%`,
|
|
|
|
|
}"
|
|
|
|
|
/>
|
2026-03-11 23:33:10 +00:00
|
|
|
</div>
|
2026-03-12 18:25:32 +00:00
|
|
|
<span
|
|
|
|
|
class="text-xs text-muted-foreground"
|
|
|
|
|
>
|
|
|
|
|
{{
|
|
|
|
|
progressPercent(
|
|
|
|
|
declaration.status,
|
|
|
|
|
)
|
|
|
|
|
}}%
|
2026-03-11 23:33:10 +00:00
|
|
|
</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-4 py-3">
|
2026-03-12 18:25:32 +00:00
|
|
|
<span
|
|
|
|
|
:class="{
|
|
|
|
|
'font-medium text-destructive':
|
|
|
|
|
declaration.due_date &&
|
|
|
|
|
declaration.due_date <
|
|
|
|
|
new Date()
|
|
|
|
|
.toISOString()
|
|
|
|
|
.slice(0, 10),
|
|
|
|
|
}"
|
|
|
|
|
>
|
|
|
|
|
{{
|
|
|
|
|
declaration.due_date || '—'
|
|
|
|
|
}}
|
2026-03-11 23:33:10 +00:00
|
|
|
</span>
|
|
|
|
|
</td>
|
|
|
|
|
<td class="px-4 py-3">
|
2026-03-12 18:25:32 +00:00
|
|
|
<Button
|
|
|
|
|
variant="ghost"
|
|
|
|
|
size="sm"
|
|
|
|
|
as-child
|
|
|
|
|
>
|
|
|
|
|
<Link
|
|
|
|
|
:href="declaration.showUrl"
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
Voir
|
2026-03-12 18:25:32 +00:00
|
|
|
<ArrowRight
|
|
|
|
|
class="ml-1 h-3 w-3"
|
|
|
|
|
/>
|
2026-03-11 23:33:10 +00:00
|
|
|
</Link>
|
|
|
|
|
</Button>
|
|
|
|
|
</td>
|
|
|
|
|
</tr>
|
|
|
|
|
</tbody>
|
|
|
|
|
</table>
|
|
|
|
|
</div>
|
|
|
|
|
</Card>
|
|
|
|
|
|
|
|
|
|
<Card v-else>
|
2026-03-12 18:25:32 +00:00
|
|
|
<CardContent
|
|
|
|
|
class="flex flex-col items-center justify-center py-12"
|
|
|
|
|
>
|
|
|
|
|
<FolderOpen
|
|
|
|
|
class="mb-3 h-12 w-12 text-muted-foreground"
|
|
|
|
|
/>
|
2026-03-11 23:33:10 +00:00
|
|
|
<p class="mb-2 text-muted-foreground">
|
2026-03-12 18:25:32 +00:00
|
|
|
Aucune déclaration ne vous est assignée pour le
|
|
|
|
|
moment.
|
2026-03-11 23:33:10 +00:00
|
|
|
</p>
|
2026-03-12 18:25:32 +00:00
|
|
|
<Button v-if="declarationsUrl" as-child>
|
|
|
|
|
<Link :href="declarationsUrl"
|
|
|
|
|
>Voir toutes les déclarations</Link
|
|
|
|
|
>
|
2026-03-11 23:33:10 +00:00
|
|
|
</Button>
|
|
|
|
|
</CardContent>
|
|
|
|
|
</Card>
|
|
|
|
|
</div>
|
|
|
|
|
</template>
|
|
|
|
|
</div>
|
|
|
|
|
</AppLayout>
|
|
|
|
|
</template>
|