feat
Desc: - Edit investasi - Portofolio Investasi - Upload bukti transfer #No Issue
This commit is contained in:
@@ -20,8 +20,9 @@ import {
|
||||
Title,
|
||||
} from "@mantine/core";
|
||||
import { useRouter } from "next/navigation";
|
||||
import dataDummy from "../dummy/data_dummy.json"
|
||||
import moment from "moment"
|
||||
import dataDummy from "../dummy/data_dummy.json";
|
||||
import moment from "moment";
|
||||
import { IconCheck, IconCircleCheck } from "@tabler/icons-react";
|
||||
|
||||
export default function MainInvestasi({
|
||||
listData,
|
||||
@@ -39,7 +40,12 @@ export default function MainInvestasi({
|
||||
<>
|
||||
{/* <pre>{JSON.stringify(listData, null, 2)}</pre> */}
|
||||
{dataDummy.map((e) => (
|
||||
<Card key={e.id} withBorder mb={"lg"} onClick={() => router.push(`/dev/investasi/detail/${e.id}`)}>
|
||||
<Card
|
||||
key={e.id}
|
||||
withBorder
|
||||
mb={"lg"}
|
||||
onClick={() => router.push(`/dev/investasi/detail/${e.id}`)}
|
||||
>
|
||||
<CardSection p={"xs"}>
|
||||
<AspectRatio ratio={16 / 9}>
|
||||
{e.imagesId ? (
|
||||
@@ -57,11 +63,7 @@ export default function MainInvestasi({
|
||||
disabled
|
||||
labelAlwaysOn
|
||||
value={e.persentase}
|
||||
marks={
|
||||
[
|
||||
{value: e.persentase, label: e.persentase + `%`}
|
||||
]
|
||||
}
|
||||
marks={[{ value: e.persentase, label: e.persentase + `%` }]}
|
||||
/>
|
||||
<Title order={4}>{e.title}</Title>
|
||||
</Box>
|
||||
@@ -96,9 +98,33 @@ export default function MainInvestasi({
|
||||
</CardSection>
|
||||
<Divider />
|
||||
<CardSection p={"md"}>
|
||||
<Group position="right">
|
||||
<Text>{moment(e.createdAt).fromNow()}</Text>
|
||||
</Group>
|
||||
{(() => {
|
||||
if (
|
||||
e.masterPencarianInvestorId -
|
||||
moment(new Date()).diff(new Date(e.createdAt), "days") ===
|
||||
0
|
||||
) {
|
||||
return (
|
||||
<>
|
||||
<Group position="right">
|
||||
<IconCircleCheck/>
|
||||
<Text>Selesai</Text>
|
||||
</Group>
|
||||
</>
|
||||
);
|
||||
} else {
|
||||
return<>
|
||||
<Group position="right" spacing={"xs"}>
|
||||
<Text>Sisa waktu:</Text>
|
||||
<Text>
|
||||
{e.masterPencarianInvestorId -
|
||||
moment(new Date()).diff(new Date(e.createdAt), "days")}
|
||||
</Text>
|
||||
<Text>Hari</Text>
|
||||
</Group>
|
||||
</>
|
||||
}
|
||||
})()}
|
||||
</CardSection>
|
||||
</Card>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user