Improve product cards/pagination, Farsi locale fonts, and super-admin migrate UI.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-07-29 16:10:43 +03:30
co-authored by Cursor
parent 2e40d5eb4c
commit f5b2193ba1
108 changed files with 2421 additions and 812 deletions
+22
View File
@@ -0,0 +1,22 @@
/** Arabic / Persian script ranges (including presentation forms). */
const RTL_SCRIPT_RE =
/[\u0600-\u06FF\u0750-\u077F\u08A0-\u08FF\uFB50-\uFDFF\uFE70-\uFEFF]/
export function isRtlScript(text: string | null | undefined): boolean {
if (!text) return false
return RTL_SCRIPT_RE.test(text)
}
export type TextLocaleAttrs = {
lang: 'fa' | 'en'
dir: 'rtl' | 'ltr'
className: string | undefined
}
/** Font + direction attrs for mixed FA/EN content fields. */
export function textLocaleAttrs(text: string | null | undefined): TextLocaleAttrs {
if (isRtlScript(text)) {
return { lang: 'fa', dir: 'rtl', className: 'faText' }
}
return { lang: 'en', dir: 'ltr', className: undefined }
}