From 65377952fbd0721ce1550c42384d723ccd7b9b1a Mon Sep 17 00:00:00 2001 From: "HATEC\\SPVDEV001" Date: Fri, 1 Mar 2024 09:20:11 +0700 Subject: generate recomendation --- .../elements/Navbar/NavbarUserDropdown.jsx | 5 ++ src/pages/my/recomendation/api/recomendation.js | 8 +++ .../components/products-recomendatison.jsx | 65 ++++++++++++++++++++++ src/pages/my/recomendation/index.jsx | 26 +++++++++ 4 files changed, 104 insertions(+) create mode 100644 src/pages/my/recomendation/api/recomendation.js create mode 100644 src/pages/my/recomendation/components/products-recomendatison.jsx create mode 100644 src/pages/my/recomendation/index.jsx (limited to 'src') diff --git a/src/core/components/elements/Navbar/NavbarUserDropdown.jsx b/src/core/components/elements/Navbar/NavbarUserDropdown.jsx index 1851ce84..42bdc12a 100644 --- a/src/core/components/elements/Navbar/NavbarUserDropdown.jsx +++ b/src/core/components/elements/Navbar/NavbarUserDropdown.jsx @@ -2,9 +2,11 @@ import { deleteAuth } from '@/core/utils/auth' import Link from '../Link/Link' import { useRouter } from 'next/router' import { signOut, useSession } from 'next-auth/react' +import useAuth from '@/core/hooks/useAuth' const NavbarUserDropdown = () => { const router = useRouter() + const atuh = useAuth() const logout = async () => { deleteAuth().then(() => { @@ -21,6 +23,9 @@ const NavbarUserDropdown = () => { Invoice & Faktur Pajak Wishlist Daftar Alamat + {!atuh?.external && + Dashboard Recomendation + } diff --git a/src/pages/my/recomendation/api/recomendation.js b/src/pages/my/recomendation/api/recomendation.js new file mode 100644 index 00000000..47ed743a --- /dev/null +++ b/src/pages/my/recomendation/api/recomendation.js @@ -0,0 +1,8 @@ +import axios from "axios" + +const GenerateRecomendations = async ({query}) => { + const GenerateRecomendationProducts = await axios(`${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/recomendation?${query}`) + + return GenerateRecomendationProducts +} +export default GenerateRecomendations \ No newline at end of file diff --git a/src/pages/my/recomendation/components/products-recomendatison.jsx b/src/pages/my/recomendation/components/products-recomendatison.jsx new file mode 100644 index 00000000..9438eb46 --- /dev/null +++ b/src/pages/my/recomendation/components/products-recomendatison.jsx @@ -0,0 +1,65 @@ +import Menu from '@/lib/auth/components/Menu'; +import { cons } from 'lodash-contrib'; + +const ProductsRecomendation = ({ id }) => { + const handleSubmit = () => {} + const handleFileChange = () => {} + return ( +
+
+ +
+
+
+

+ Generate Recomendation +

+
+
+

Contoh Excel

+ + + + + + + + + + + + + +
ProductQty
Tekiro Long Nose Pliers Tang Lancip10
+
+
+
+
+ + +
+ +
+
+
+
+ ); +}; + +export default ProductsRecomendation; diff --git a/src/pages/my/recomendation/index.jsx b/src/pages/my/recomendation/index.jsx new file mode 100644 index 00000000..684b30c2 --- /dev/null +++ b/src/pages/my/recomendation/index.jsx @@ -0,0 +1,26 @@ +import DesktopView from '@/core/components/views/DesktopView'; +import MobileView from '@/core/components/views/MobileView'; +import IsAuth from '../../../lib/auth/components/IsAuth'; +import AppLayout from '@/core/components/layouts/AppLayout'; +import BasicLayout from '@/core/components/layouts/BasicLayout'; +import dynamic from 'next/dynamic'; +import Seo from '@/core/components/Seo' + +const ProductsRecomendation = dynamic(() => import('./components/products-recomendatison')) +export default function MyRecomendation() { + return ( + + + + + + + + + + + + + + ); +} -- cgit v1.2.3