Desc:
- Perubahan metode pengambilan data dari API ke use server
This commit is contained in:
2023-10-09 17:08:16 +08:00
parent ca66c3d2d8
commit 2b0ecc7bef
29 changed files with 87 additions and 128 deletions

View File

@@ -0,0 +1,4 @@
import KatalogView from "./view";
import KatalogLayout from "./layout";
export {KatalogView, KatalogLayout}

View File

@@ -0,0 +1,41 @@
"use client";
import { Logout } from "@/app_modules/auth";
import { ActionIcon, AppShell, Group, Header, Text } from "@mantine/core";
import { IconUserSearch, IconAward, IconQrcode, IconArrowLeft, IconPencilPlus } from "@tabler/icons-react";
import { useRouter } from "next/navigation";
export default function KatalogLayout({ children }: { children: any }) {
const router = useRouter()
return (
<>
<AppShell
header={
<Header height={50} bg={"dark"}>
<Group position="apart" align="center" h={50} p={"sm"}>
<Group spacing={"sm"}>
<ActionIcon variant="transparent" onClick={() => router.push("/dev/home")}>
<IconArrowLeft/>
</ActionIcon>
{/* <ActionIcon>
<IconAward />
</ActionIcon> */}
</Group>
<Text color="white" fw={"bold"}>
Katalog
</Text>
<Group spacing={"sm"}>
<ActionIcon variant="transparent" onClick={() => router.push("/dev/portofolio/create")}>
<IconPencilPlus />
</ActionIcon>
{/* <Logout /> */}
</Group>
</Group>
</Header>
}
>
{children}
</AppShell>
</>
);
}

View File

@@ -0,0 +1,47 @@
"use client";
import { Warna } from "@/app/lib/warna";
import {
ActionIcon,
BackgroundImage,
Box,
Center,
Flex,
Grid,
Group,
Image,
Paper,
Text,
} from "@mantine/core";
import { useShallowEffect } from "@mantine/hooks";
import {
IconAddressBook,
IconCamera,
IconEditCircle,
IconGenderFemale,
IconGenderMale,
IconHome,
IconMail,
} from "@tabler/icons-react";
import { useRouter } from "next/navigation";
import { useState } from "react";
import { ProfileView, getProfile } from "../profile";
import { gs_profile } from "../profile/state/global_state";
import { myConsole } from "@/app/fun/my_console";
import { useAtom } from "jotai";
import { loadDataProfile } from "../profile/fun/fun_get_profile";
import { getFotoProfile } from "../profile/api/get-foto-profile";
import { ApiHipmi } from "@/app/lib/api";
import { ListPortofolioView } from "../portofolio";
import { User } from "@prisma/client";
import { USER_PROFILE } from "@/app_modules/models/user_profile";
import { LIST_PORTOFOLIO } from "@/app_modules/models/portofolio";
export default function KatalogView({ user, listPorto }: { user: USER_PROFILE, listPorto: LIST_PORTOFOLIO }) {
return (
<>
<ProfileView user={user} />
<ListPortofolioView listPorto={listPorto} />
</>
);
}