Extract admin dashboard from ghabilee-frontend2 into a dedicated Next.js app for backoffice.ghabilee.ir (no SEO indexing / Clarity).
26 lines
682 B
TypeScript
26 lines
682 B
TypeScript
'use client'
|
|
|
|
/**
|
|
* Shared helpers for consumer payment query keys on the current URL.
|
|
* Used by EventPaymentModalController and EventDetailOverlay dismiss cleanup.
|
|
*/
|
|
|
|
export const PAYMENT_QUERY_KEYS = ['payment', 'bookingId', 'depositId', 'status'] as const
|
|
|
|
export const stripPaymentQueryParams = (search: string): string => {
|
|
const params = new URLSearchParams(search)
|
|
|
|
for (const key of PAYMENT_QUERY_KEYS) {
|
|
params.delete(key)
|
|
}
|
|
|
|
return params.toString()
|
|
}
|
|
|
|
export const hasActivePaymentQuery = (search: string): boolean => {
|
|
const params = new URLSearchParams(search)
|
|
const mode = params.get('payment')
|
|
|
|
return mode === 'checkout' || mode === 'result'
|
|
}
|