auto save

This commit is contained in:
hamid zarghami
2026-04-30 11:58:11 +03:30
parent 25585f9e17
commit cd495fe6ad
2 changed files with 16 additions and 2 deletions
+9 -1
View File
@@ -13,7 +13,7 @@ const Editor: FC = () => {
const [isLayersPanelOpen, setIsLayersPanelOpen] = useState(false)
const { loadPages, pages } = useEditorStore()
const { data } = useGetCatalogById(id!)
const { scheduleUpdate } = useUpdateCatalog()
const { scheduleUpdate, isSaving } = useUpdateCatalog()
useEffect(() => {
if (data?.data && data?.data?.content) {
@@ -46,6 +46,14 @@ const Editor: FC = () => {
"flex h-full w-full",
isLayersPanelOpen ? "xl:pl-[296px]" : "xl:pl-[80px]"
)}>
{isSaving ? (
<div className="fixed top-10 left-10 z-50 rounded-full shadow-sm">
<div className="flex items-center gap-2 text-sm text-gray-700">
<span className="h-4 w-4 animate-spin rounded-full border-2 border-gray-300 border-t-black" />
{/* <span>در حال ذخیره ...</span> */}
</div>
</div>
) : null}
<LayersPanel isOpen={isLayersPanelOpen} setIsOpen={setIsLayersPanelOpen} />
<EditorCanvas catalogSize={data?.data?.size} />
<EditorSidebar />