diff --git a/client/components/tickets/ticket-complete-modal.tsx b/client/components/tickets/ticket-complete-modal.tsx new file mode 100644 index 0000000..bbed5b7 --- /dev/null +++ b/client/components/tickets/ticket-complete-modal.tsx @@ -0,0 +1,107 @@ +"use client"; + +import { BookOpen, CheckCircle } from "lucide-react"; +import { FormEvent, useState } from "react"; + +import Button from "../ui/button"; +import LabeledIcon from "../ui/labeled-icon"; +import Modal from "../ui/modal"; + +export interface TicketCompleteModalProps { + isOpen: boolean; + ticketTitle: string; + existingDocumentation?: string; + onClose: () => void; + onComplete: (documentation: string) => void; + isLoading?: boolean; +} + +export default function TicketCompleteModal({ + isOpen, + ticketTitle, + existingDocumentation = "", + onClose, + onComplete, + isLoading = false, +}: TicketCompleteModalProps) { + const [documentation, setDocumentation] = useState(existingDocumentation); + + const handleSubmit = (e: FormEvent) => { + e.preventDefault(); + onComplete(documentation); + }; + + const handleClose = () => { + setDocumentation(existingDocumentation); // Reset to original value + onClose(); + }; + + return ( + +
+
+
+ +

+ Complete Ticket +

+
+

+ Ticket: {ticketTitle} +

+

+ Before marking this ticket as complete, please document how you resolved it. + This helps other team members learn from your solution. +

+
+ +
+
+ +