fix frontend
This commit is contained in:
@@ -1067,6 +1067,15 @@ function MessageRow({
|
||||
</div>
|
||||
|
||||
<div className="flex items-center gap-2 flex-shrink-0">
|
||||
{message.is_conserved && (
|
||||
<span
|
||||
className="inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-xs font-medium bg-teal-100 text-teal-700 border border-teal-200 flex-shrink-0"
|
||||
title={`Conservato${message.conserved_at ? ' il ' + new Date(message.conserved_at).toLocaleDateString('it-IT') : ''}`}
|
||||
>
|
||||
<ShieldCheck className="h-3 w-3" />
|
||||
Conservato
|
||||
</span>
|
||||
)}
|
||||
<PecStateBadge state={message.state} />
|
||||
<span className="text-xs text-muted-foreground">
|
||||
{formatRelative(message.received_at || message.sent_at || message.created_at)}
|
||||
@@ -1211,31 +1220,40 @@ function MessageRow({
|
||||
</button>
|
||||
)}
|
||||
|
||||
{/* Invia a Conservazione / Rimuovi da Da Conservare */}
|
||||
{canConserve && viewMode !== 'trash' && viewMode !== 'conservation_archived' && (
|
||||
<button
|
||||
onClick={onToggleConserve}
|
||||
title={viewMode === 'conservation_pending' ? 'Rimuovi da Da Conservare' : 'Invia a Conservazione'}
|
||||
className={cn(
|
||||
'p-1 rounded hover:bg-muted transition-all',
|
||||
message.is_pending_conservation
|
||||
? 'opacity-100'
|
||||
: hovered
|
||||
{/* Conservazione: badge fisso se gia' conservato, pulsante interattivo altrimenti */}
|
||||
{canConserve && viewMode !== 'trash' && (
|
||||
message.is_conserved ? (
|
||||
<span
|
||||
title={`Gia' conservato${message.conserved_at ? ' il ' + new Date(message.conserved_at).toLocaleDateString('it-IT') : ''}`}
|
||||
className="p-1 cursor-default"
|
||||
>
|
||||
<ShieldCheck className="h-4 w-4 text-teal-500" />
|
||||
</span>
|
||||
) : (
|
||||
<button
|
||||
onClick={onToggleConserve}
|
||||
title={viewMode === 'conservation_pending' ? 'Rimuovi da Da Conservare' : 'Invia a Conservazione'}
|
||||
className={cn(
|
||||
'p-1 rounded hover:bg-muted transition-all',
|
||||
message.is_pending_conservation
|
||||
? 'opacity-100'
|
||||
: 'opacity-0 pointer-events-none',
|
||||
)}
|
||||
>
|
||||
{viewMode === 'conservation_pending' ? (
|
||||
<ShieldX className="h-4 w-4 text-orange-500" />
|
||||
) : (
|
||||
<ShieldCheck
|
||||
className={cn(
|
||||
'h-4 w-4',
|
||||
message.is_pending_conservation ? 'text-teal-600' : 'text-muted-foreground',
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
</button>
|
||||
: hovered
|
||||
? 'opacity-100'
|
||||
: 'opacity-0 pointer-events-none',
|
||||
)}
|
||||
>
|
||||
{viewMode === 'conservation_pending' ? (
|
||||
<ShieldX className="h-4 w-4 text-orange-500" />
|
||||
) : (
|
||||
<ShieldCheck
|
||||
className={cn(
|
||||
'h-4 w-4',
|
||||
message.is_pending_conservation ? 'text-teal-600' : 'text-muted-foreground',
|
||||
)}
|
||||
/>
|
||||
)}
|
||||
</button>
|
||||
)
|
||||
)}
|
||||
|
||||
{/* Indicatore allegati */}
|
||||
|
||||
@@ -27,6 +27,7 @@ import {
|
||||
ChevronDown,
|
||||
FolderOpen,
|
||||
Plus,
|
||||
ShieldCheck,
|
||||
} from 'lucide-react'
|
||||
import toast from 'react-hot-toast'
|
||||
import { Button } from '@/components/ui/Button'
|
||||
@@ -1162,6 +1163,25 @@ export function MessageDetailPage() {
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Banner "Conservato" */}
|
||||
{message.is_conserved && (
|
||||
<div className="bg-teal-50 border-b border-teal-200 px-6 py-2.5 flex items-center gap-3">
|
||||
<ShieldCheck className="h-4 w-4 text-teal-600 flex-shrink-0" />
|
||||
<span className="text-sm text-teal-700">
|
||||
Questo messaggio e' stato conservato in modo sostitutivo
|
||||
{message.conserved_at
|
||||
? ` il ${new Date(message.conserved_at).toLocaleDateString('it-IT', {
|
||||
day: '2-digit',
|
||||
month: '2-digit',
|
||||
year: 'numeric',
|
||||
hour: '2-digit',
|
||||
minute: '2-digit',
|
||||
})}`
|
||||
: ''}.
|
||||
</span>
|
||||
</div>
|
||||
)}
|
||||
|
||||
{/* Contenuto */}
|
||||
<div className="flex-1 overflow-y-auto">
|
||||
<div className="max-w-4xl mx-auto px-6 py-8 space-y-6">
|
||||
|
||||
Reference in New Issue
Block a user