feat: add ticket solution closure loop
This commit is contained in:
@@ -23,6 +23,7 @@ const STATUS_ACTION_LABELS: Partial<Record<TicketStatus, string>> = {
|
||||
type TicketTransitionDialogProps = {
|
||||
open: boolean
|
||||
status: TicketStatus | null
|
||||
actionLabel?: string
|
||||
onOpenChange: (open: boolean) => void
|
||||
onSubmit: (status: TicketStatus, remark: string) => Promise<void>
|
||||
}
|
||||
@@ -30,12 +31,13 @@ type TicketTransitionDialogProps = {
|
||||
export function TicketTransitionDialog({
|
||||
open,
|
||||
status,
|
||||
actionLabel: customActionLabel,
|
||||
onOpenChange,
|
||||
onSubmit
|
||||
}: TicketTransitionDialogProps) {
|
||||
const [remark, setRemark] = React.useState('')
|
||||
const [submitting, setSubmitting] = React.useState(false)
|
||||
const actionLabel = status ? STATUS_ACTION_LABELS[status] ?? '调整状态' : '调整状态'
|
||||
const actionLabel = customActionLabel ?? (status ? STATUS_ACTION_LABELS[status] ?? '调整状态' : '调整状态')
|
||||
|
||||
React.useEffect(() => {
|
||||
if (!open) {
|
||||
|
||||
Reference in New Issue
Block a user