admin/features/events/detail/admin-event-detail/AdminEventRevisionRejectModal.tsx
alisaza e1eaf5eff5 feat: initial ghabilee-admin backoffice app
Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js
app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
2026-09-05 13:12:59 +03:30

65 lines
1.8 KiB
TypeScript
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use client'
import { useState } from 'react'
import Input from '@/components/formElements/Input'
import Modal from '@/components/modals/Modal'
import { coerceToString } from '@/helpers'
import { texts } from '@/texts'
interface AdminEventRevisionRejectModalProps {
isLoading: boolean
isOpen: boolean
onOpenChange: (open: boolean) => void
onReject: (rejectionReason: string) => void
}
const AdminEventRevisionRejectModal = ({ isLoading, isOpen, onOpenChange, onReject }: AdminEventRevisionRejectModalProps) => {
const [rejectionReason, setRejectionReason] = useState('')
const reset = () => {
setRejectionReason('')
}
return (
<Modal
acceptDanger
acceptBtnDisabled={rejectionReason.trim().length < 3}
acceptBtnText={texts.events.revisionReject}
isLoading={isLoading}
isOpen={isOpen}
rejectBtnText="انصراف"
size="lg"
title={texts.events.revisionReject}
onAccept={() => {
onReject(rejectionReason.trim())
}}
onOpenChange={(open) => {
onOpenChange(open)
if (!open) reset()
}}
onReject={() => {
onOpenChange(false)
reset()
}}
>
<div className="flex flex-col gap-4">
<p className="text-sm text-text-muted">دلیل رد برای میزبان ارسال میشود؛ نسخهٔ عمومی فعلی رویداد بدون تغییر میماند.</p>
<Input
generalType="textarea"
label={texts.events.revisionRejectReasonLabel}
name="revisionRejectionReason"
placeholder="حداقل ۳ کاراکتر"
textAreaMinRows={3}
value={rejectionReason}
onValueChange={(value) => {
setRejectionReason(coerceToString(value))
}}
/>
</div>
</Modal>
)
}
export default AdminEventRevisionRejectModal