diff options
Diffstat (limited to 'src2/pages/shop/checkout/finish.js')
| -rw-r--r-- | src2/pages/shop/checkout/finish.js | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/src2/pages/shop/checkout/finish.js b/src2/pages/shop/checkout/finish.js new file mode 100644 index 00000000..df284f8a --- /dev/null +++ b/src2/pages/shop/checkout/finish.js @@ -0,0 +1,47 @@ +import WithAuth from "@/components/auth/WithAuth"; +import Link from "@/components/elements/Link"; +import AppBar from "@/components/layouts/AppBar"; +import Header from "@/components/layouts/Header"; +import Layout from "@/components/layouts/Layout"; +import apiOdoo from "@/core/utils/apiOdoo"; +import { useAuth } from "@/core/utils/auth"; +import { EnvelopeIcon } from "@heroicons/react/24/outline"; +import { useRouter } from "next/router"; +import { useEffect, useState } from "react"; + +export default function FinishCheckout() { + const router = useRouter(); + const { id } = router.query; + const [ auth ] = useAuth(); + const [ transaction, setTransactions ] = useState(null); + + useEffect(() => { + const loadTransaction = async () => { + if (auth && id) { + const dataTransaction = await apiOdoo('GET', `/api/v1/partner/${auth.partner_id}/sale_order/${id}`); + setTransactions(dataTransaction); + } + }; + loadTransaction(); + }); + + return ( + <WithAuth> + <Layout> + <AppBar title="Pembelian Berhasil" /> + + <div className="m-4 rounded-xl bg-yellow_r-4 text-center border border-yellow_r-7"> + <div className="px-4 py-6 text-yellow_r-12"> + <p className="h2 mb-2">Terima Kasih atas Pembelian Anda</p> + <p className="text-yellow_r-11 mb-4 leading-6">Rincian belanja sudah kami kirimkan ke email anda. Mohon dicek kembali. jika tidak menerima email, anda dapat menghubungi kami disini.</p> + <p className="mb-2 font-medium">{ transaction?.name }</p> + <p className="text-caption-2 text-yellow_r-11">No. Transaksi</p> + </div> + <Link href={transaction?.id ? `/my/transaction/${transaction.id}` : '/'} className="bg-yellow_r-6 text-yellow_r-12 rounded-b-xl py-4 block"> + Lihat detail pembelian Anda disini + </Link> + </div> + </Layout> + </WithAuth> + ); +}
\ No newline at end of file |
