Enhanced various components to utilize the alert modal for user confirmations before executing critical actions. This includes marking messages as read, saving notification rules, restoring reviews, sending replies, changing ticket statuses, and managing event commissions. The integration improves user experience by ensuring actions are intentional and provides clear feedback on the outcomes.
29 lines
870 B
TypeScript
29 lines
870 B
TypeScript
import type { AdminEventDetailData } from './types'
|
|
|
|
import { texts } from '@/texts'
|
|
|
|
/** راهنمای کوتاه اکشنهای lifecycle — بسته به وضعیت فعلی رویداد */
|
|
export const resolveAdminEventLifecycleHint = (event: AdminEventDetailData): string | null => {
|
|
if (event.status === 'draft' && !event.adminApprovedAt) {
|
|
return texts.events.adminLifecycleHintDraftUnapproved
|
|
}
|
|
|
|
if (event.status === 'draft' && event.adminApprovedAt) {
|
|
return texts.events.adminLifecycleHintDraftApproved
|
|
}
|
|
|
|
if (event.status === 'pending_review') {
|
|
return texts.events.adminLifecycleHintPendingReview
|
|
}
|
|
|
|
if (event.status === 'published' || event.status === 'full') {
|
|
return texts.events.adminLifecycleHintPublished
|
|
}
|
|
|
|
if (event.bookedCount === 0) {
|
|
return texts.events.adminLifecycleHintDeleteOnly
|
|
}
|
|
|
|
return null
|
|
}
|