import { Box, Divider, Group, Tabs } from "@mantine/core"; import { IconLink, IconMessage, IconPaperclip } from "@tabler/icons-react"; import { useState } from "react"; import type { Card, CardMessage, User } from "../types"; import { CardChatPanel } from "./CardChatPanel"; import { CardFilesPanel } from "./CardFilesPanel"; import { CardLinksPanel } from "./CardLinksPanel"; import { CardForm, CardFormValues } from "./CardForm"; interface Props { card: Card; users: User[]; currentUserId?: string; requesterOptions: string[]; tagOptions: string[]; onSubmit: (v: CardFormValues) => Promise | void; onCancel: () => void; // When set, the chat panel auto-scrolls to this message id and pulses // it briefly. Used when opening a card from a notification click. highlightMessageId?: string; } export function CardEditPanel({ card, users, currentUserId, requesterOptions, tagOptions, onSubmit, onCancel, highlightMessageId, }: Props) { const [messages, setMessages] = useState([]); const [liveCard, setLiveCard] = useState(card); const [filesRefreshKey, setFilesRefreshKey] = useState(0); const wrappedSubmit = async (v: CardFormValues) => { setLiveCard((c) => ({ ...c, title: v.title, description: v.description, requester: v.requester, tags: v.tags, assignee_id: v.assignee_id })); await onSubmit(v); }; const bumpFiles = () => setFilesRefreshKey((k) => k + 1); return ( }>Chat }>Enlaces }>Archivos ); }