Deksripsi:
- Progress investasi
- Tampilan voting
## No issue
This commit is contained in:
2024-09-10 12:12:31 +08:00
parent 84b7b381f6
commit 3b7e9977f6
163 changed files with 1556 additions and 428 deletions

View File

@@ -1,6 +1,8 @@
import { Investasi_ViewDetailSahamSaya } from "./detail/view_detail_saham_saya";
import PdfToImage from "./file_view/view_file_viewer";
import { Investasi_ViewBeranda } from "./main/view_beranda";
import { Investasi_ViewPortofolio } from "./main/view_portofolio";
import { Investasi_ViewPortofolioReview } from "./main/portofolio/view_portofolio_review";
import { Investasi_ViewSahamSaya } from "./main/view_saham_saya";
import { Investasi_ViewTransaksiBerhasil } from "./status_transaksi/view_invoice_berhasil";
import { Investasi_ViewTransaksiGagal } from "./status_transaksi/view_transaksi_gagal";
@@ -19,3 +21,5 @@ export { Investasi_ViewTransaksiBerhasil };
export { PdfToImage as Investasi_ViewFileViewer };
export { Investasi_ViewSahamSaya };
export { Investasi_ViewDetailSahamSaya };
export { Investasi_ViewPortofolio };

View File

@@ -0,0 +1,60 @@
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { Box, Center } from "@mantine/core";
import { data } from "autoprefixer";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
import { Investasi_ComponentCardPortofolio_NotPublish } from "../../../_component";
import {
investasi_funGetAllInvestasiNonPublishByUserId,
investasi_funGetSuccessTransactionById,
} from "../../../_fun";
import { useState } from "react";
import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
export function Investasi_ViewPortofolioDraft({
listData,
}: {
listData: any[];
}) {
const [data, setData] = useState(listData);
const [activePage, setActivePage] = useState(1);
return (
<>
<Box>
{_.isEmpty(data) ? (
<ComponentGlobal_IsEmptyData />
) : (
<ScrollOnly
height="75vh"
renderLoading={() => (
<Center>
<ComponentGlobal_Loader size={25} />
</Center>
)}
data={data}
setData={setData}
moreData={async () => {
const loadData =
await investasi_funGetAllInvestasiNonPublishByUserId({
page: activePage + 1,
statusId: "3",
});
setActivePage((val) => val + 1);
return loadData;
}}
>
{(item) => (
<Investasi_ComponentCardPortofolio_NotPublish
data={item}
path={NEW_RouterInvestasi.detail_draft}
/>
)}
</ScrollOnly>
)}
</Box>
</>
);
}

View File

@@ -0,0 +1,50 @@
import { useState } from "react";
import { Investasi_ComponentCardPortofolioPublish } from "../../../_component";
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { Box, Center } from "@mantine/core";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
import { investasi_funGetSuccessTransactionById } from "../../../_fun";
export function Investasi_ViewPortofolioPublish({
listData,
}: {
listData: any[];
}) {
const [data, setData] = useState(listData);
const [activePage, setActivePage] = useState(1);
return (
<>
<Box>
{_.isEmpty(data) ? (
<ComponentGlobal_IsEmptyData />
) : (
<ScrollOnly
height="75vh"
renderLoading={() => (
<Center>
<ComponentGlobal_Loader size={25} />
</Center>
)}
data={data}
setData={setData}
moreData={async () => {
const loadData = await investasi_funGetSuccessTransactionById({
page: activePage + 1,
});
setActivePage((val) => val + 1);
return loadData;
}}
>
{(item) => (
<Investasi_ComponentCardPortofolioPublish data={item as any} />
)}
</ScrollOnly>
)}
</Box>
</>
);
}

View File

@@ -0,0 +1,60 @@
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { Box, Center } from "@mantine/core";
import { data } from "autoprefixer";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
import { Investasi_ComponentCardPortofolio_NotPublish } from "../../../_component";
import {
investasi_funGetAllInvestasiNonPublishByUserId,
investasi_funGetSuccessTransactionById,
} from "../../../_fun";
import { useState } from "react";
import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
export function Investasi_ViewPortofolioReject({
listData,
}: {
listData: any[];
}) {
const [data, setData] = useState(listData);
const [activePage, setActivePage] = useState(1);
return (
<>
<Box>
{_.isEmpty(data) ? (
<ComponentGlobal_IsEmptyData />
) : (
<ScrollOnly
height="75vh"
renderLoading={() => (
<Center>
<ComponentGlobal_Loader size={25} />
</Center>
)}
data={data}
setData={setData}
moreData={async () => {
const loadData =
await investasi_funGetAllInvestasiNonPublishByUserId({
page: activePage + 1,
statusId: "4",
});
setActivePage((val) => val + 1);
return loadData;
}}
>
{(item) => (
<Investasi_ComponentCardPortofolio_NotPublish
data={item}
path={NEW_RouterInvestasi.detail_reject}
/>
)}
</ScrollOnly>
)}
</Box>
</>
);
}

View File

@@ -0,0 +1,60 @@
import ComponentGlobal_IsEmptyData from "@/app_modules/_global/component/is_empty_data";
import ComponentGlobal_Loader from "@/app_modules/_global/component/loader";
import { Box, Center } from "@mantine/core";
import { data } from "autoprefixer";
import _ from "lodash";
import { ScrollOnly } from "next-scroll-loader";
import { Investasi_ComponentCardPortofolio_NotPublish } from "../../../_component";
import {
investasi_funGetAllInvestasiNonPublishByUserId,
investasi_funGetSuccessTransactionById,
} from "../../../_fun";
import { useState } from "react";
import { NEW_RouterInvestasi } from "@/app/lib/router_hipmi/router_investasi";
export function Investasi_ViewPortofolioReview({
listData,
}: {
listData: any[];
}) {
const [data, setData] = useState(listData);
const [activePage, setActivePage] = useState(1);
return (
<>
<Box>
{_.isEmpty(data) ? (
<ComponentGlobal_IsEmptyData />
) : (
<ScrollOnly
height="75vh"
renderLoading={() => (
<Center>
<ComponentGlobal_Loader size={25} />
</Center>
)}
data={data}
setData={setData}
moreData={async () => {
const loadData =
await investasi_funGetAllInvestasiNonPublishByUserId({
page: activePage + 1,
statusId: "2",
});
setActivePage((val) => val + 1);
return loadData;
}}
>
{(item) => (
<Investasi_ComponentCardPortofolio_NotPublish
data={item}
path={NEW_RouterInvestasi.detail_review}
/>
)}
</ScrollOnly>
)}
</Box>
</>
);
}

View File

@@ -0,0 +1,136 @@
import { AccentColor, MainColor } from "@/app_modules/_global/color";
import { MODEL_NEW_DEFAULT_MASTER } from "@/app_modules/model_global/interface";
import {
Box,
Button,
Group,
SimpleGrid,
Space,
Stack,
Tabs,
} from "@mantine/core";
import { useAtom } from "jotai";
import { useState } from "react";
import { gs_investasi_status } from "../../g_state";
import { Investasi_ViewPortofolioPublish } from "./portofolio/view_portofolio_publish";
import { Investasi_ViewPortofolioReview } from "./portofolio/view_portofolio_review";
import { Investasi_ViewPortofolioDraft } from "./portofolio/view_portofolio_draft";
import { Investasi_ViewPortofolioReject } from "./portofolio/view_portofolio_reject";
export function Investasi_ViewPortofolio({
listStatus,
listDataPublish,
listDataReview,
listDataDraft,
listDataReject,
}: {
listStatus: any[];
listDataPublish: any[];
listDataReview: any[];
listDataDraft: any[];
listDataReject: any[];
}) {
const [activeTab, setActiveTab] = useAtom(gs_investasi_status);
const [activeStatus, setActiveStatus] =
useState<MODEL_NEW_DEFAULT_MASTER[]>(listStatus);
// return (
// <>
// <Box h={"82vh"}>
// <Group grow h={"5vh"}>
// {activeStatus.map((e) => (
// <Box
// // component={Button}
// // radius={"xl"}
// key={e.id}
// // onClick={() => setActiveTab(e.name)}
// style={{
// alignContent: "center",
// justifyContent: "center",
// transition: "0.5s",
// backgroundColor:
// activeTab === e.name ? MainColor.yellow : "gray",
// border:
// activeTab === e.name ? `1px solid ${AccentColor.yellow}` : "",
// color: activeTab === e.name ? "black" : "white",
// }}
// >
// {e.name}
// </Box>
// ))}
// </Group>
// <Space h={"1vh"} />
// <Box h={"76vh"}>
// {activeTab === "Publish" && (
// <Investasi_ViewPortofolioPublish listData={listDataPublish} />
// )}
// {activeTab === "Review" && <Investasi_ViewPortofolioReview />}
// </Box>
// </Box>
// </>
// );
return (
<>
<Tabs
variant="pills"
radius="xl"
defaultValue={activeTab}
value={activeTab}
onTabChange={setActiveTab}
styles={{
tabsList: {
// backgroundColor: MainColor.black,
position: "sticky",
top: 0,
zIndex: 99,
},
}}
>
<Stack>
<Tabs.List grow mb={"xs"}>
{activeStatus.map((e) => (
<Tabs.Tab
w={"20%"}
key={e.id}
value={e.name}
fw={"bold"}
style={{
transition: "ease 0.5s ",
backgroundColor:
activeTab === e.name ? MainColor.yellow : AccentColor.blue,
// border:
// activeTab === e.name
// ? `1px solid ${AccentColor.yellow}`
// : "",
color: activeTab === e.name ? "black" : "white",
}}
>
{e.name}
</Tabs.Tab>
))}
</Tabs.List>
<Tabs.Panel value="Publish">
<Investasi_ViewPortofolioPublish listData={listDataPublish} />
</Tabs.Panel>
<Tabs.Panel value="Review">
<Investasi_ViewPortofolioReview listData={listDataReview} />
</Tabs.Panel>
<Tabs.Panel value="Draft">
<Investasi_ViewPortofolioDraft listData={listDataDraft} />
</Tabs.Panel>
<Tabs.Panel value="Reject">
<Investasi_ViewPortofolioReject listData={listDataReject} />
</Tabs.Panel>
</Stack>
</Tabs>
</>
);
}