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
@@ -10,6 +10,8 @@ import {
User,
Settings2,
Paperclip,
Reply,
CheckCircle2,
} from "lucide-react";
import { Button } from "@/shared/components/ui/button";
import { Badge } from "@/shared/components/ui/badge";
@@ -39,6 +41,8 @@ interface RegistryTableProps {
onEdit: (entry: RegistryEntry) => void;
onDelete: (id: string) => void;
onClose: (id: string) => void;
/** Create a new entry linked as reply (conex) to this entry */
onReply?: (entry: RegistryEntry) => void;
}
// ── Column definitions ──
@@ -175,6 +179,7 @@ export function RegistryTable({
onEdit,
onDelete,
onClose,
onReply,
}: RegistryTableProps) {
const [visibleCols, setVisibleCols] = useState<Set<ColumnId>>(
() => DEFAULT_VISIBLE,
@@ -465,10 +470,38 @@ export function RegistryTable({
e.stopPropagation();
onEdit(entry);
}}
title="Editează"
title="Editeaza"
>
<Pencil className="h-3.5 w-3.5" />
</Button>
{onReply && (
<Button
variant="ghost"
size="icon"
className="h-7 w-7 text-blue-600"
onClick={(e) => {
e.stopPropagation();
onReply(entry);
}}
title="Conex — creeaza raspuns"
>
<Reply className="h-3.5 w-3.5" />
</Button>
)}
{entry.status === "deschis" && (
<Button
variant="ghost"
size="icon"
className="h-7 w-7 text-green-600"
onClick={(e) => {
e.stopPropagation();
onClose(entry.id);
}}
title="Inchide"
>
<CheckCircle2 className="h-3.5 w-3.5" />
</Button>
)}
</div>
</td>
</tr>