import { Text, useColorModeValue, VStack } from "@hope-ui/solid" import { createEffect, createMemo, createSignal, lazy, Match, on, Suspense, Switch, } from "solid-js" import { Error, FullLoading, LinkWithBase } from "~/components" import { useObjTitle, usePath, useRouter, useT } from "~/hooks" import { getPagination, objStore, password, recordHistory, setPassword, /*layout,*/ State, } from "~/store" const Folder = lazy(() => import("./folder/Folder")) const File = lazy(() => import("./file/File")) const Password = lazy(() => import("./Password")) // const ListSkeleton = lazy(() => import("./Folder/ListSkeleton")); // const GridSkeleton = lazy(() => import("./Folder/GridSkeleton")); const [objBoxRef, setObjBoxRef] = createSignal() export { objBoxRef } export const Obj = () => { const t = useT() const cardBg = useColorModeValue("white", "$neutral3") const { pathname, searchParams } = useRouter() const { handlePathChange, refresh } = usePath() const pagination = getPagination() const page = createMemo(() => { return pagination.type === "pagination" ? parseInt(searchParams["page"], 10) || 1 : undefined }) const perPage = createMemo(() => { return pagination.type === "pagination" ? parseInt(searchParams["per_page"], 10) || pagination.size : undefined }) let lastPathname: string let lastPage: number | undefined createEffect( on([pathname, page, perPage], async ([pathname, page, perPage]) => { if (lastPathname) { recordHistory(lastPathname, lastPage) } lastPathname = pathname lastPage = page useObjTitle() await handlePathChange(pathname, page, undefined, undefined, perPage) }), ) return ( setObjBoxRef(el)} class="obj-box" w="$full" rounded="$xl" bgColor={cardBg()} p="$2" shadow="$lg" spacing="$2" > }> {/* }> */} refresh(true)} > {t("global.have_account")} {t("global.go_login")} ) }