fix create sub bidang portofolio

This commit is contained in:
2025-05-08 17:53:50 +08:00
parent def4460f71
commit 96b3dc2674
14 changed files with 769 additions and 24 deletions

View File

@@ -3,22 +3,24 @@
import { APIs } from "@/lib";
import { pathAssetImage } from "@/lib/path_asset_image";
import { RouterImagePreview } from "@/lib/router_hipmi/router_image_preview";
import { Center, Image, Skeleton } from "@mantine/core";
import { Center, Image, MantineNumberSize, Skeleton } from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import { useRouter } from "next/navigation";
import { useState } from "react";
type IRadius = "xs" | "sm" | "md" | "lg" | "xl";
type IRadius = MantineNumberSize | undefined
export function ComponentGlobal_LoadImage({
fileId,
maw,
h,
radius,
style,
}: {
fileId: string;
maw?: number | string;
h?: number;
radius?: IRadius;
style?: React.CSSProperties;
}) {
const router = useRouter();
const [isImage, setIsImage] = useState<boolean | null>(null);
@@ -44,7 +46,7 @@ export function ComponentGlobal_LoadImage({
if (isImage === null)
return (
<Center h={"100%"}>
<Skeleton h={250} radius={"sm"} w={250} />
</Center>
@@ -63,6 +65,9 @@ export function ComponentGlobal_LoadImage({
<>
<Center h={"100%"}>
<Image
style={{
...style
}}
onClick={() => {
setIsLoading(true);
router.push(RouterImagePreview.main({ id: fileId }), {