mirror of
https://git.meshkee.com/Meshkee/dashboards.git
synced 2026-08-11 22:30:58 +04:30
Improve product cards/pagination, Farsi locale fonts, and super-admin migrate UI.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
co-authored by
Cursor
parent
2e40d5eb4c
commit
f5b2193ba1
@@ -1,4 +1,5 @@
|
||||
import { useEffect, useRef, useState } from 'react'
|
||||
import { createPortal } from 'react-dom'
|
||||
import { Plus, Sparkles, Trash2, X } from 'lucide-react'
|
||||
import type { TechnicalFieldType, TechnicalFormFieldDraft } from '../types/technicalForm'
|
||||
import { createId } from '../utils/id'
|
||||
@@ -18,6 +19,7 @@ interface TechnicalFormModalProps {
|
||||
onChange: (fields: TechnicalFormFieldDraft[]) => void
|
||||
onSave: () => void
|
||||
onGenerate?: () => void
|
||||
onGenerateClick?: () => void
|
||||
}
|
||||
|
||||
const ANIMATION_MS = 220
|
||||
@@ -51,6 +53,7 @@ export function TechnicalFormModal({
|
||||
onChange,
|
||||
onSave,
|
||||
onGenerate,
|
||||
onGenerateClick,
|
||||
}: TechnicalFormModalProps) {
|
||||
const [mounted, setMounted] = useState(open)
|
||||
const [closing, setClosing] = useState(false)
|
||||
@@ -166,7 +169,7 @@ export function TechnicalFormModal({
|
||||
return true
|
||||
})
|
||||
|
||||
return (
|
||||
return createPortal(
|
||||
<div
|
||||
className={`${styles.overlay} ${closing ? styles.overlayOut : styles.overlayIn}`}
|
||||
onClick={onClose}
|
||||
@@ -314,11 +317,11 @@ export function TechnicalFormModal({
|
||||
</div>
|
||||
|
||||
<div className={fieldStyles.toolbar}>
|
||||
{onGenerate && (
|
||||
{(onGenerateClick ?? onGenerate) && (
|
||||
<button
|
||||
type="button"
|
||||
className={aiStyles.aiBtn}
|
||||
onClick={onGenerate}
|
||||
onClick={onGenerateClick ?? onGenerate}
|
||||
disabled={isLoading || isSaving || isGenerating}
|
||||
>
|
||||
<Sparkles size={16} />
|
||||
@@ -356,5 +359,7 @@ export function TechnicalFormModal({
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
,
|
||||
document.body,
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user