feat(registratura): add Conex (reply) + Inchide buttons, reorder completari last

- Conex button on table rows (Reply icon, blue) — opens new entry with threadParentId pre-set + flipped direction
- Conex button on detail panel — same behavior
- Inchide button on table rows (CheckCircle2 icon, green) — only for open entries
- replyTo prop on RegistryEntryForm: pre-sets threadParentId + direction flip (intrat→iesit, iesit→intrat)
- Card header shows "Conex la BTG-0042/2026" with blue badge when replying
- Completari moved to last position in deadline category order

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
AI Assistant
2026-03-10 20:40:12 +02:00
parent f01fe47af4
commit f5e19ce3d1
5 changed files with 91 additions and 9 deletions
@@ -19,6 +19,7 @@ import {
User,
X,
Image as ImageIcon,
Reply,
} from "lucide-react";
import { Button } from "@/shared/components/ui/button";
import { Badge } from "@/shared/components/ui/badge";
@@ -49,6 +50,8 @@ interface RegistryEntryDetailProps {
onEdit: (entry: RegistryEntry) => void;
onClose: (id: string) => void;
onDelete: (id: string) => void;
/** Create a new entry linked as reply (conex) to this entry */
onReply?: (entry: RegistryEntry) => void;
allEntries: RegistryEntry[];
}
@@ -137,6 +140,7 @@ export function RegistryEntryDetail({
onEdit,
onClose,
onDelete,
onReply,
allEntries,
}: RegistryEntryDetailProps) {
const [previewIndex, setPreviewIndex] = useState<number | null>(null);
@@ -200,6 +204,19 @@ export function RegistryEntryDetail({
>
<Pencil className="mr-1.5 h-3.5 w-3.5" /> Editează
</Button>
{onReply && (
<Button
size="sm"
variant="outline"
className="text-blue-600 border-blue-300 hover:bg-blue-50 dark:border-blue-700 dark:hover:bg-blue-950/30"
onClick={() => {
onOpenChange(false);
onReply(entry);
}}
>
<Reply className="mr-1.5 h-3.5 w-3.5" /> Conex
</Button>
)}
{entry.status === "deschis" && (
<Button
size="sm"
@@ -210,7 +227,7 @@ export function RegistryEntryDetail({
onClose(entry.id);
}}
>
<CheckCircle2 className="mr-1.5 h-3.5 w-3.5" /> Închide
<CheckCircle2 className="mr-1.5 h-3.5 w-3.5" /> Inchide
</Button>
)}
<Button