tanapa env

This commit is contained in:
2024-08-16 11:53:24 +08:00
parent 34031355fe
commit 2960318424
86 changed files with 350 additions and 113 deletions

View File

@@ -0,0 +1,46 @@
"use client";
import { Group, Button, Loader } from "@mantine/core";
import { IconChevronLeft } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
export default function ComponentAdminGlobal_BackButton({
path,
}: {
path?: string;
}) {
const router = useRouter();
const [isLoading, setLoading] = useState(false);
return (
<>
<Group>
<Button
// loaderPosition="center"
// loading={isLoading ? true : false}
c={"gray"}
leftIcon={
isLoading ? (
<Loader size={"xs"} color={"gray"} />
) : (
<IconChevronLeft />
)
}
variant="white"
onClick={() => {
setLoading(true);
// setTimeout(() => , 3000);
if (path == null) {
router.back();
} else {
router.push(path);
}
}}
>
Kembali
</Button>
</Group>
</>
);
}