tanstack_start_ts 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.wrangler/deploy/config.json +1 -0
- package/bunfig.toml +6 -0
- package/components.json +22 -0
- package/config.json +0 -0
- package/dist/client/.assetsignore +2 -0
- package/dist/client/assets/ProductCard-DbIkJAE-.js +1 -0
- package/dist/client/assets/about-AskxOruL.js +1 -0
- package/dist/client/assets/admin-BZVcAQM3.js +1 -0
- package/dist/client/assets/admin.functions--RdVcuBx.js +1 -0
- package/dist/client/assets/admin.login-QgrF_9Fp.js +1 -0
- package/dist/client/assets/affiliate-disclosure-BIAsA-HO.js +1 -0
- package/dist/client/assets/categories-D0N418mK.js +1 -0
- package/dist/client/assets/category._slug-aCaQm14E.js +1 -0
- package/dist/client/assets/contact-PhvO-V15.js +1 -0
- package/dist/client/assets/faq-BsiHWPM8.js +1 -0
- package/dist/client/assets/hero-bg-BP2eVUIX.jpg +0 -0
- package/dist/client/assets/index-BU9rnkF3.js +1 -0
- package/dist/client/assets/index-BpJWZkva.js +1 -0
- package/dist/client/assets/index-vRX-zAyq.js +1 -0
- package/dist/client/assets/login-DteE0ZGp.js +1 -0
- package/dist/client/assets/logo-pSNfLJQk.png +0 -0
- package/dist/client/assets/privacy-B_Pu7040.js +1 -0
- package/dist/client/assets/product-links-BkZ41Gv3.js +1 -0
- package/dist/client/assets/product._id-BVUysCW-.js +1 -0
- package/dist/client/assets/products.functions-cGzRziKO.js +1 -0
- package/dist/client/assets/profile-CveRcKq2.js +1 -0
- package/dist/client/assets/reset-password-ySEjItX_.js +1 -0
- package/dist/client/assets/saved-CHtdQDJF.js +1 -0
- package/dist/client/assets/search-CXWfET1y.js +1 -0
- package/dist/client/assets/signup-CEx90iuV.js +1 -0
- package/dist/client/assets/styles-DrNJG0BO.css +1 -0
- package/dist/client/assets/terms-VqJ9kX9b.js +1 -0
- package/dist/client/assets/update-password-C-d0ix5e.js +1 -0
- package/dist/client/assets/vendor-aria-hidden-DvXkyWUv.js +1 -0
- package/dist/client/assets/vendor-class-variance-authority-5VPnzWs2.js +1 -0
- package/dist/client/assets/vendor-clsx-B-dksMZM.js +1 -0
- package/dist/client/assets/vendor-cookie-es-CS0aJGDi.js +1 -0
- package/dist/client/assets/vendor-detect-node-es-l0sNRNKZ.js +1 -0
- package/dist/client/assets/vendor-floating-ui-core-BlUy28sp.js +1 -0
- package/dist/client/assets/vendor-floating-ui-dom-BxK0hn2R.js +1 -0
- package/dist/client/assets/vendor-floating-ui-react-dom-Bas3975S.js +1 -0
- package/dist/client/assets/vendor-floating-ui-utils-BfYUAVcw.js +1 -0
- package/dist/client/assets/vendor-framer-motion-BMdL-cuX.js +9 -0
- package/dist/client/assets/vendor-get-nonce-C-Z93AgS.js +1 -0
- package/dist/client/assets/vendor-iceberg-js-tWD4K6Lg.js +1 -0
- package/dist/client/assets/vendor-lovable.dev-cloud-auth-js-VuzqtJVg.js +1 -0
- package/dist/client/assets/vendor-lucide-react-b5K2fehp.js +1 -0
- package/dist/client/assets/vendor-motion-dom-BETJamZt.js +1 -0
- package/dist/client/assets/vendor-motion-utils-BuWewJbj.js +1 -0
- package/dist/client/assets/vendor-radix-ui-primitive-Dc_FVRD7.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-accordion-C22Rgxe9.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-arrow-DMHj2mKI.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-avatar-CVPBkFXg.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-collapsible-BvM-4sKX.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-collection-D9KtqmHm.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-compose-refs-Cvq0AS8Z.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-context-CAqqn5Nx.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-dialog-DZ01vOLq.js +5 -0
- package/dist/client/assets/vendor-radix-ui-react-direction-DxZwNuei.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-dismissable-layer-Dqgrs55Y.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-dropdown-menu-0uzvrqkn.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-focus-guards-DgWoZ-fP.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-focus-scope-BLIu5QaL.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-id-bpga_rLa.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-menu-D0qf2r6_.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-popper-BafIylxU.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-portal-BnAsfNCS.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-presence-C-f3UKQ2.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-primitive-zTHwXNoz.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-roving-focus-jyJB8K2E.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-slot-6LXHJrHl.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-use-callback-ref-E91aPc6s.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-use-controllable-state-Ca3eMtxa.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-use-effect-event-CPeX4A3c.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-use-escape-keydown-7n3YsXFo.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-use-is-hydrated-C1PY1qNv.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-use-layout-effect-B3AcGWPy.js +1 -0
- package/dist/client/assets/vendor-radix-ui-react-use-size-CXS04sct.js +1 -0
- package/dist/client/assets/vendor-react-dom-BnNs-kzm.js +9 -0
- package/dist/client/assets/vendor-react-gJPiVnX5.js +1 -0
- package/dist/client/assets/vendor-react-remove-scroll-DHKl-IMP.js +4 -0
- package/dist/client/assets/vendor-react-remove-scroll-bar-CSjdInc2.js +38 -0
- package/dist/client/assets/vendor-react-style-singleton-BqHpkgXn.js +1 -0
- package/dist/client/assets/vendor-scheduler-7OC5HNn7.js +1 -0
- package/dist/client/assets/vendor-seroval-B_Fur-nl.js +3 -0
- package/dist/client/assets/vendor-seroval-plugins-CBHnPkZJ.js +1 -0
- package/dist/client/assets/vendor-sonner-71-LdGG1.js +1 -0
- package/dist/client/assets/vendor-supabase-auth-js-DWrN-bIx.js +18 -0
- package/dist/client/assets/vendor-supabase-functions-js-uY_V-TxC.js +1 -0
- package/dist/client/assets/vendor-supabase-phoenix-BzEf37Ve.js +2 -0
- package/dist/client/assets/vendor-supabase-postgrest-js-C4rBWbCx.js +4 -0
- package/dist/client/assets/vendor-supabase-realtime-js-D6BlOYKE.js +23 -0
- package/dist/client/assets/vendor-supabase-storage-js-BG98L3Zz.js +1 -0
- package/dist/client/assets/vendor-supabase-supabase-js-DCCzdwBJ.js +1 -0
- package/dist/client/assets/vendor-tailwind-merge-Ct12j0u0.js +1 -0
- package/dist/client/assets/vendor-tanstack-history-C617CaxG.js +1 -0
- package/dist/client/assets/vendor-tanstack-query-core-7wuJJ5ZL.js +1 -0
- package/dist/client/assets/vendor-tanstack-react-query-HImzo8sX.js +1 -0
- package/dist/client/assets/vendor-tanstack-react-router-sIZLK-LU.js +1 -0
- package/dist/client/assets/vendor-tanstack-react-start-client-GiYCfWmf.js +1 -0
- package/dist/client/assets/vendor-tanstack-react-store-EvTi3ahh.js +1 -0
- package/dist/client/assets/vendor-tanstack-router-core-Cr7bYUZv.js +1 -0
- package/dist/client/assets/vendor-tanstack-start-client-core-C-00BBOu.js +2 -0
- package/dist/client/assets/vendor-tanstack-start-fn-stubs-l0sNRNKZ.js +1 -0
- package/dist/client/assets/vendor-tanstack-store-BC7mA7pq.js +1 -0
- package/dist/client/assets/vendor-tslib-Du-meQkk.js +1 -0
- package/dist/client/assets/vendor-use-callback-ref-C_fIAtot.js +1 -0
- package/dist/client/assets/vendor-use-sidecar-Bh0DDN6h.js +1 -0
- package/dist/client/assets/vendor-use-sync-external-store-ZvKHXaIn.js +1 -0
- package/dist/client/assets/vendor-vercel-analytics-DwPM5BWs.js +1 -0
- package/dist/client/assets/vendor-zod-By9teAtI.js +1 -0
- package/dist/client/robots.txt +2 -0
- package/dist/server/.dev.vars +5 -0
- package/dist/server/.vite/manifest.json +2528 -0
- package/dist/server/assets/ProductCard-CUPXy5Eo.js +149 -0
- package/dist/server/assets/_tanstack-start-manifest_v-do7vTWFD.js +4 -0
- package/dist/server/assets/about-TfKQw0Ga.js +28 -0
- package/dist/server/assets/admin-DspfJOJk.js +578 -0
- package/dist/server/assets/admin.functions-B78ppWLR.js +645 -0
- package/dist/server/assets/admin.functions-BWlKBoTL.js +93 -0
- package/dist/server/assets/admin.login-CV7QfeA6.js +139 -0
- package/dist/server/assets/affiliate-disclosure-B1wI1cDb.js +86 -0
- package/dist/server/assets/auth-middleware-Cn49MidW.js +62 -0
- package/dist/server/assets/categories-Z7jnAYZP.js +108 -0
- package/dist/server/assets/category._slug-D0XY3FGK.js +112 -0
- package/dist/server/assets/contact-IzyONsXs.js +104 -0
- package/dist/server/assets/faq-aRhB_CR3.js +133 -0
- package/dist/server/assets/hero-bg-BP2eVUIX.jpg +0 -0
- package/dist/server/assets/index-BTPHbXw9.js +221 -0
- package/dist/server/assets/index-ByJkHkrU.js +30 -0
- package/dist/server/assets/login-Dvy5Dm0f.js +175 -0
- package/dist/server/assets/logo-pSNfLJQk.png +0 -0
- package/dist/server/assets/privacy-B6Wiez1P.js +93 -0
- package/dist/server/assets/product-links-CGYEPP56.js +16 -0
- package/dist/server/assets/product._id-BpRa-1z0.js +231 -0
- package/dist/server/assets/products.functions-DSlmibYN.js +209 -0
- package/dist/server/assets/products.functions-DlHkRiqi.js +24 -0
- package/dist/server/assets/profile-B0NWzVAZ.js +314 -0
- package/dist/server/assets/reset-password-CY-rmqMr.js +115 -0
- package/dist/server/assets/saved-7FA6Dbom.js +126 -0
- package/dist/server/assets/search-Yw5c_fZa.js +329 -0
- package/dist/server/assets/signup-UPzgZo4i.js +143 -0
- package/dist/server/assets/styles-DrNJG0BO.css +1 -0
- package/dist/server/assets/terms-CMnX95bP.js +89 -0
- package/dist/server/assets/update-password-Cr94ea8n.js +131 -0
- package/dist/server/assets/vendor-aria-hidden-DPa16MWu.js +122 -0
- package/dist/server/assets/vendor-class-variance-authority-0YxJPB9Y.js +44 -0
- package/dist/server/assets/vendor-cloudflare-unenv-preset-ya0VEFBz.js +250 -0
- package/dist/server/assets/vendor-clsx-DgYk2OaC.js +16 -0
- package/dist/server/assets/vendor-cookie-es-DAoofYiI.js +44 -0
- package/dist/server/assets/vendor-detect-node-es-l0sNRNKZ.js +1 -0
- package/dist/server/assets/vendor-floating-ui-core-3tkK0THV.js +726 -0
- package/dist/server/assets/vendor-floating-ui-dom-C-cPtgJv.js +626 -0
- package/dist/server/assets/vendor-floating-ui-react-dom-CRG6gBpH.js +319 -0
- package/dist/server/assets/vendor-floating-ui-utils-DmXANH-E.js +320 -0
- package/dist/server/assets/vendor-framer-motion-X4zAkX3J.js +1979 -0
- package/dist/server/assets/vendor-get-nonce-DiSj3EHl.js +9 -0
- package/dist/server/assets/vendor-h3-v2-CCobnLY5.js +287 -0
- package/dist/server/assets/vendor-iceberg-js-bHCkXyJn.js +534 -0
- package/dist/server/assets/vendor-isbot-CZ7WjwVs.js +21 -0
- package/dist/server/assets/vendor-lovable.dev-cloud-auth-js-BE03njZw.js +180 -0
- package/dist/server/assets/vendor-lucide-react-Ddew6HYb.js +458 -0
- package/dist/server/assets/vendor-motion-dom-D2MTwGIG.js +5983 -0
- package/dist/server/assets/vendor-motion-utils-LJlIFN6m.js +161 -0
- package/dist/server/assets/vendor-radix-ui-primitive-B-mNdDrH.js +11 -0
- package/dist/server/assets/vendor-radix-ui-react-accordion-1Izf6x00.js +308 -0
- package/dist/server/assets/vendor-radix-ui-react-arrow-B882lnFK.js +23 -0
- package/dist/server/assets/vendor-radix-ui-react-avatar-BVgZt2Ab.js +209 -0
- package/dist/server/assets/vendor-radix-ui-react-collapsible-DCBbMZiS.js +147 -0
- package/dist/server/assets/vendor-radix-ui-react-collection-BZ2srfgU.js +150 -0
- package/dist/server/assets/vendor-radix-ui-react-compose-refs-D3qsKVk1.js +39 -0
- package/dist/server/assets/vendor-radix-ui-react-context-BVoNDLue.js +78 -0
- package/dist/server/assets/vendor-radix-ui-react-dialog-DlxMaNYK.js +406 -0
- package/dist/server/assets/vendor-radix-ui-react-direction-Dt_WDL1t.js +9 -0
- package/dist/server/assets/vendor-radix-ui-react-dismissable-layer-CjsuPohV.js +210 -0
- package/dist/server/assets/vendor-radix-ui-react-dropdown-menu-DVxKumY8.js +263 -0
- package/dist/server/assets/vendor-radix-ui-react-focus-guards-D_6NoePE.js +29 -0
- package/dist/server/assets/vendor-radix-ui-react-focus-scope-DEIhTJJH.js +206 -0
- package/dist/server/assets/vendor-radix-ui-react-id-DFFpgh6m.js +14 -0
- package/dist/server/assets/vendor-radix-ui-react-menu-CiTMLwjT.js +893 -0
- package/dist/server/assets/vendor-radix-ui-react-popper-23Ye2Vyc.js +286 -0
- package/dist/server/assets/vendor-radix-ui-react-portal-CZCH5uPk.js +16 -0
- package/dist/server/assets/vendor-radix-ui-react-presence-CaAULlDU.js +128 -0
- package/dist/server/assets/vendor-radix-ui-react-primitive-BeOk3UYa.js +124 -0
- package/dist/server/assets/vendor-radix-ui-react-roving-focus-DES9GR8l.js +224 -0
- package/dist/server/assets/vendor-radix-ui-react-slot-DUhZbzoH.js +103 -0
- package/dist/server/assets/vendor-radix-ui-react-use-callback-ref-BynBgohw.js +11 -0
- package/dist/server/assets/vendor-radix-ui-react-use-controllable-state-C9KpT6DG.js +69 -0
- package/dist/server/assets/vendor-radix-ui-react-use-effect-event-gpNY2xjS.js +1 -0
- package/dist/server/assets/vendor-radix-ui-react-use-escape-keydown-CcYRQ2pp.js +17 -0
- package/dist/server/assets/vendor-radix-ui-react-use-is-hydrated-D_LcBPXY.js +15 -0
- package/dist/server/assets/vendor-radix-ui-react-use-layout-effect-1LNLXAjr.js +6 -0
- package/dist/server/assets/vendor-radix-ui-react-use-size-D6fiKJQo.js +39 -0
- package/dist/server/assets/vendor-react-DvBrY0qp.js +511 -0
- package/dist/server/assets/vendor-react-dom-yvMLPM0j.js +10484 -0
- package/dist/server/assets/vendor-react-remove-scroll-BNtiEvVN.js +328 -0
- package/dist/server/assets/vendor-react-remove-scroll-bar-hLqRASRk.js +82 -0
- package/dist/server/assets/vendor-react-style-singleton-BXjcXskB.js +69 -0
- package/dist/server/assets/vendor-rou3-3NaGPdI8.js +8 -0
- package/dist/server/assets/vendor-seroval-dJyC-Zhz.js +1775 -0
- package/dist/server/assets/vendor-seroval-plugins-Pq_U2meB.js +58 -0
- package/dist/server/assets/vendor-sonner-CqbjhsRh.js +1086 -0
- package/dist/server/assets/vendor-srvx-BA-baEX9.js +6 -0
- package/dist/server/assets/vendor-supabase-auth-js-D4xjVprw.js +7602 -0
- package/dist/server/assets/vendor-supabase-functions-js-sWy4UYn1.js +322 -0
- package/dist/server/assets/vendor-supabase-phoenix-Bw3Uh2Nn.js +1777 -0
- package/dist/server/assets/vendor-supabase-postgrest-js-AO-BXa7I.js +4938 -0
- package/dist/server/assets/vendor-supabase-realtime-js-BtdNgJbm.js +2111 -0
- package/dist/server/assets/vendor-supabase-storage-js-Dk_MrPYO.js +2679 -0
- package/dist/server/assets/vendor-supabase-supabase-js-D1EEtG3j.js +697 -0
- package/dist/server/assets/vendor-tailwind-merge-BHb_obmC.js +3255 -0
- package/dist/server/assets/vendor-tanstack-history-C4pKJmkt.js +204 -0
- package/dist/server/assets/vendor-tanstack-query-core-PwwTR5ld.js +2552 -0
- package/dist/server/assets/vendor-tanstack-react-query-hhHzXAK1.js +190 -0
- package/dist/server/assets/vendor-tanstack-react-router-XzqpA65A.js +1120 -0
- package/dist/server/assets/vendor-tanstack-react-start-RvWUpvat.js +37 -0
- package/dist/server/assets/vendor-tanstack-react-start-client-gpNY2xjS.js +1 -0
- package/dist/server/assets/vendor-tanstack-react-start-server-uj_Y9pEN.js +15 -0
- package/dist/server/assets/vendor-tanstack-react-store-gpNY2xjS.js +1 -0
- package/dist/server/assets/vendor-tanstack-router-core-6wywV3KN.js +4252 -0
- package/dist/server/assets/vendor-tanstack-start-client-core-DoOKV2pA.js +1741 -0
- package/dist/server/assets/vendor-tanstack-start-fn-stubs-l0sNRNKZ.js +1 -0
- package/dist/server/assets/vendor-tanstack-start-server-core-CsAstXv7.js +1421 -0
- package/dist/server/assets/vendor-tanstack-start-storage-context-DgH9hIJT.js +17 -0
- package/dist/server/assets/vendor-tanstack-store-l0sNRNKZ.js +1 -0
- package/dist/server/assets/vendor-tslib-_8ICaZ64.js +67 -0
- package/dist/server/assets/vendor-unenv-DUvF4YIF.js +544 -0
- package/dist/server/assets/vendor-use-callback-ref-DMFDRvmi.js +66 -0
- package/dist/server/assets/vendor-use-sidecar-DG1tHua4.js +106 -0
- package/dist/server/assets/vendor-use-sync-external-store-rZ8vi0It.js +64 -0
- package/dist/server/assets/vendor-vercel-analytics-oP8BDp0L.js +168 -0
- package/dist/server/assets/vendor-zod-BRyQdbC-.js +3580 -0
- package/dist/server/index.js +158 -0
- package/dist/server/wrangler.json +1 -0
- package/enable-powershell.ps1 +7 -0
- package/eslint.config.js +41 -0
- package/lint.bat +4 -0
- package/package.json +95 -0
- package/public/robots.txt +2 -0
- package/run-npm-build.cjs +20 -0
- package/run-npm-build.js +20 -0
- package/src/assets/hero-bg.jpg +0 -0
- package/src/assets/logo.png +0 -0
- package/src/components/scrollsy/Footer.tsx +68 -0
- package/src/components/scrollsy/LiveTicker.tsx +31 -0
- package/src/components/scrollsy/Logo.tsx +28 -0
- package/src/components/scrollsy/Nav.tsx +255 -0
- package/src/components/scrollsy/ProductCard.tsx +190 -0
- package/src/components/scrollsy/ProductFilters.tsx +226 -0
- package/src/components/scrollsy/SupportWidget.tsx +197 -0
- package/src/components/ui/accordion.tsx +51 -0
- package/src/components/ui/alert-dialog.tsx +115 -0
- package/src/components/ui/alert.tsx +49 -0
- package/src/components/ui/aspect-ratio.tsx +5 -0
- package/src/components/ui/avatar.tsx +47 -0
- package/src/components/ui/badge.tsx +32 -0
- package/src/components/ui/breadcrumb.tsx +101 -0
- package/src/components/ui/button.tsx +49 -0
- package/src/components/ui/calendar.tsx +177 -0
- package/src/components/ui/card.tsx +55 -0
- package/src/components/ui/carousel.tsx +240 -0
- package/src/components/ui/chart.tsx +331 -0
- package/src/components/ui/checkbox.tsx +26 -0
- package/src/components/ui/collapsible.tsx +11 -0
- package/src/components/ui/command.tsx +143 -0
- package/src/components/ui/context-menu.tsx +187 -0
- package/src/components/ui/dialog.tsx +104 -0
- package/src/components/ui/drawer.tsx +98 -0
- package/src/components/ui/dropdown-menu.tsx +188 -0
- package/src/components/ui/form.tsx +171 -0
- package/src/components/ui/hover-card.tsx +27 -0
- package/src/components/ui/input-otp.tsx +69 -0
- package/src/components/ui/input.tsx +22 -0
- package/src/components/ui/label.tsx +21 -0
- package/src/components/ui/menubar.tsx +229 -0
- package/src/components/ui/navigation-menu.tsx +120 -0
- package/src/components/ui/pagination.tsx +98 -0
- package/src/components/ui/popover.tsx +31 -0
- package/src/components/ui/progress.tsx +25 -0
- package/src/components/ui/radio-group.tsx +36 -0
- package/src/components/ui/resizable.tsx +37 -0
- package/src/components/ui/scroll-area.tsx +44 -0
- package/src/components/ui/select.tsx +152 -0
- package/src/components/ui/separator.tsx +24 -0
- package/src/components/ui/sheet.tsx +122 -0
- package/src/components/ui/sidebar.tsx +744 -0
- package/src/components/ui/skeleton.tsx +7 -0
- package/src/components/ui/slider.tsx +23 -0
- package/src/components/ui/sonner.tsx +23 -0
- package/src/components/ui/switch.tsx +27 -0
- package/src/components/ui/table.tsx +94 -0
- package/src/components/ui/tabs.tsx +53 -0
- package/src/components/ui/textarea.tsx +21 -0
- package/src/components/ui/toggle-group.tsx +57 -0
- package/src/components/ui/toggle.tsx +42 -0
- package/src/components/ui/tooltip.tsx +32 -0
- package/src/hooks/use-auth.ts +26 -0
- package/src/hooks/use-mobile.tsx +19 -0
- package/src/integrations/lovable/index.ts +41 -0
- package/src/lib/admin.functions.ts +564 -0
- package/src/lib/error-capture.ts +27 -0
- package/src/lib/error-page.ts +30 -0
- package/src/lib/product-links.ts +39 -0
- package/src/lib/products.functions.ts +101 -0
- package/src/lib/utils.ts +6 -0
- package/src/routeTree.gen.ts +480 -0
- package/src/router.tsx +16 -0
- package/src/routes/__root.tsx +177 -0
- package/src/routes/about.tsx +66 -0
- package/src/routes/admin.login.tsx +95 -0
- package/src/routes/admin.tsx +811 -0
- package/src/routes/affiliate-disclosure.tsx +35 -0
- package/src/routes/categories.tsx +57 -0
- package/src/routes/category.$slug.tsx +51 -0
- package/src/routes/contact.tsx +69 -0
- package/src/routes/faq.tsx +63 -0
- package/src/routes/index.tsx +269 -0
- package/src/routes/login.tsx +160 -0
- package/src/routes/privacy.tsx +39 -0
- package/src/routes/product.$id.tsx +212 -0
- package/src/routes/profile.tsx +393 -0
- package/src/routes/reset-password.tsx +71 -0
- package/src/routes/saved.tsx +83 -0
- package/src/routes/search.tsx +136 -0
- package/src/routes/signup.tsx +108 -0
- package/src/routes/sitemap[.]xml.ts +34 -0
- package/src/routes/terms.tsx +40 -0
- package/src/routes/update-password.tsx +91 -0
- package/src/server.ts +80 -0
- package/src/start.ts +24 -0
- package/src/styles.css +333 -0
- package/terminal-test-output.txt +1 -0
- package/tsconfig.json +27 -0
- package/vercel.json +26 -0
- package/vite.config.ts +38 -0
- package/wrangler.jsonc +7 -0
|
@@ -0,0 +1,578 @@
|
|
|
1
|
+
import { j as jsxRuntimeExports, r as reactExports } from "./vendor-react-DvBrY0qp.js";
|
|
2
|
+
import { L as Link } from "./vendor-tanstack-react-router-XzqpA65A.js";
|
|
3
|
+
import { a as useQuery, b as useQueryClient, u as useMutation } from "./vendor-tanstack-react-query-hhHzXAK1.js";
|
|
4
|
+
import { u as useServerFn } from "./vendor-tanstack-react-start-RvWUpvat.js";
|
|
5
|
+
import { a as isAdmin, g as grantSelfAdmin, b as listAllProducts, u as upsertProduct, d as deleteProduct, i as importProductFromLink, l as listAdmins, c as createAdmin } from "./admin.functions-BWlKBoTL.js";
|
|
6
|
+
import { g as getCategories } from "./products.functions-DlHkRiqi.js";
|
|
7
|
+
import { w as useAuth } from "./vendor-tanstack-start-client-core-DoOKV2pA.js";
|
|
8
|
+
import { t as toast } from "./vendor-sonner-CqbjhsRh.js";
|
|
9
|
+
import { r as resolveBuyUrl } from "./product-links-CGYEPP56.js";
|
|
10
|
+
import { t as Shield, g as Crown, p as Plus, D as UserPlus, z as TrendingUp, i as Flame, y as Star, E as ExternalLink, P as PenLine, T as Trash2, K as KeyRound, M as Mail, l as Lock, x as Sparkles, L as Link2, k as LoaderCircle, F as FileDown, R as RefreshCw } from "./vendor-lucide-react-Ddew6HYb.js";
|
|
11
|
+
import "./vendor-tanstack-router-core-6wywV3KN.js";
|
|
12
|
+
import "./vendor-tanstack-history-C4pKJmkt.js";
|
|
13
|
+
import "./vendor-seroval-dJyC-Zhz.js";
|
|
14
|
+
import "./vendor-seroval-plugins-Pq_U2meB.js";
|
|
15
|
+
import "./vendor-cookie-es-DAoofYiI.js";
|
|
16
|
+
import "node:stream/web";
|
|
17
|
+
import "node:stream";
|
|
18
|
+
import "./vendor-react-dom-yvMLPM0j.js";
|
|
19
|
+
import "./vendor-isbot-CZ7WjwVs.js";
|
|
20
|
+
import "./vendor-tanstack-query-core-PwwTR5ld.js";
|
|
21
|
+
import "./vendor-tanstack-start-server-core-CsAstXv7.js";
|
|
22
|
+
import "node:async_hooks";
|
|
23
|
+
import "./vendor-h3-v2-CCobnLY5.js";
|
|
24
|
+
import "./vendor-rou3-3NaGPdI8.js";
|
|
25
|
+
import "./vendor-srvx-BA-baEX9.js";
|
|
26
|
+
import "./vendor-tanstack-start-storage-context-DgH9hIJT.js";
|
|
27
|
+
import "./vendor-tanstack-react-start-server-uj_Y9pEN.js";
|
|
28
|
+
import "./auth-middleware-Cn49MidW.js";
|
|
29
|
+
import "./vendor-supabase-supabase-js-D1EEtG3j.js";
|
|
30
|
+
import "./vendor-supabase-postgrest-js-AO-BXa7I.js";
|
|
31
|
+
import "./vendor-supabase-realtime-js-BtdNgJbm.js";
|
|
32
|
+
import "./vendor-supabase-phoenix-Bw3Uh2Nn.js";
|
|
33
|
+
import "./vendor-supabase-storage-js-Dk_MrPYO.js";
|
|
34
|
+
import "./vendor-iceberg-js-bHCkXyJn.js";
|
|
35
|
+
import "./vendor-supabase-auth-js-D4xjVprw.js";
|
|
36
|
+
import "./vendor-tslib-_8ICaZ64.js";
|
|
37
|
+
import "./vendor-supabase-functions-js-sWy4UYn1.js";
|
|
38
|
+
import "./vendor-zod-BRyQdbC-.js";
|
|
39
|
+
import "./vendor-vercel-analytics-oP8BDp0L.js";
|
|
40
|
+
import "./vendor-radix-ui-react-dropdown-menu-DVxKumY8.js";
|
|
41
|
+
import "./vendor-radix-ui-primitive-B-mNdDrH.js";
|
|
42
|
+
import "./vendor-radix-ui-react-compose-refs-D3qsKVk1.js";
|
|
43
|
+
import "./vendor-radix-ui-react-context-BVoNDLue.js";
|
|
44
|
+
import "./vendor-radix-ui-react-use-controllable-state-C9KpT6DG.js";
|
|
45
|
+
import "./vendor-radix-ui-react-use-layout-effect-1LNLXAjr.js";
|
|
46
|
+
import "./vendor-radix-ui-react-primitive-BeOk3UYa.js";
|
|
47
|
+
import "./vendor-radix-ui-react-menu-CiTMLwjT.js";
|
|
48
|
+
import "./vendor-radix-ui-react-collection-BZ2srfgU.js";
|
|
49
|
+
import "./vendor-radix-ui-react-direction-Dt_WDL1t.js";
|
|
50
|
+
import "./vendor-radix-ui-react-dismissable-layer-CjsuPohV.js";
|
|
51
|
+
import "./vendor-radix-ui-react-use-callback-ref-BynBgohw.js";
|
|
52
|
+
import "./vendor-radix-ui-react-use-escape-keydown-CcYRQ2pp.js";
|
|
53
|
+
import "./vendor-radix-ui-react-focus-guards-D_6NoePE.js";
|
|
54
|
+
import "./vendor-radix-ui-react-focus-scope-DEIhTJJH.js";
|
|
55
|
+
import "./vendor-radix-ui-react-popper-23Ye2Vyc.js";
|
|
56
|
+
import "./vendor-floating-ui-react-dom-CRG6gBpH.js";
|
|
57
|
+
import "./vendor-floating-ui-dom-C-cPtgJv.js";
|
|
58
|
+
import "./vendor-floating-ui-core-3tkK0THV.js";
|
|
59
|
+
import "./vendor-floating-ui-utils-DmXANH-E.js";
|
|
60
|
+
import "./vendor-radix-ui-react-arrow-B882lnFK.js";
|
|
61
|
+
import "./vendor-radix-ui-react-use-size-D6fiKJQo.js";
|
|
62
|
+
import "./vendor-radix-ui-react-portal-CZCH5uPk.js";
|
|
63
|
+
import "./vendor-radix-ui-react-presence-CaAULlDU.js";
|
|
64
|
+
import "./vendor-radix-ui-react-roving-focus-DES9GR8l.js";
|
|
65
|
+
import "./vendor-radix-ui-react-id-DFFpgh6m.js";
|
|
66
|
+
import "./vendor-aria-hidden-DPa16MWu.js";
|
|
67
|
+
import "./vendor-react-remove-scroll-BNtiEvVN.js";
|
|
68
|
+
import "./vendor-react-remove-scroll-bar-hLqRASRk.js";
|
|
69
|
+
import "./vendor-react-style-singleton-BXjcXskB.js";
|
|
70
|
+
import "./vendor-get-nonce-DiSj3EHl.js";
|
|
71
|
+
import "./vendor-use-sidecar-DG1tHua4.js";
|
|
72
|
+
import "./vendor-use-callback-ref-DMFDRvmi.js";
|
|
73
|
+
import "./vendor-clsx-DgYk2OaC.js";
|
|
74
|
+
import "./vendor-tailwind-merge-BHb_obmC.js";
|
|
75
|
+
import "./vendor-radix-ui-react-avatar-BVgZt2Ab.js";
|
|
76
|
+
import "./vendor-radix-ui-react-slot-DUhZbzoH.js";
|
|
77
|
+
import "./vendor-radix-ui-react-use-is-hydrated-D_LcBPXY.js";
|
|
78
|
+
import "./vendor-use-sync-external-store-rZ8vi0It.js";
|
|
79
|
+
import "./vendor-class-variance-authority-0YxJPB9Y.js";
|
|
80
|
+
import "./vendor-radix-ui-react-dialog-DlxMaNYK.js";
|
|
81
|
+
import "./vendor-framer-motion-X4zAkX3J.js";
|
|
82
|
+
import "./vendor-motion-dom-D2MTwGIG.js";
|
|
83
|
+
import "./vendor-motion-utils-LJlIFN6m.js";
|
|
84
|
+
function AdminPage() {
|
|
85
|
+
const {
|
|
86
|
+
user,
|
|
87
|
+
loading
|
|
88
|
+
} = useAuth();
|
|
89
|
+
const isAdminFn = useServerFn(isAdmin);
|
|
90
|
+
const grantFn = useServerFn(grantSelfAdmin);
|
|
91
|
+
const {
|
|
92
|
+
data: roleData,
|
|
93
|
+
isLoading: roleLoading,
|
|
94
|
+
refetch
|
|
95
|
+
} = useQuery({
|
|
96
|
+
queryKey: ["is-admin", user?.id],
|
|
97
|
+
enabled: !!user,
|
|
98
|
+
queryFn: () => isAdminFn()
|
|
99
|
+
});
|
|
100
|
+
if (loading || user && roleLoading) return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-10", children: "Loading…" });
|
|
101
|
+
if (!user) {
|
|
102
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-md mx-auto pt-24 px-4 text-center glass-strong rounded-3xl p-8", children: [
|
|
103
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Shield, { className: "w-12 h-12 mx-auto text-brand-magenta" }),
|
|
104
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "font-display text-2xl font-bold mt-4", children: "Admin sign-in required" }),
|
|
105
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground mt-2", children: "Admins must sign in with their assigned Admin ID, email and password." }),
|
|
106
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Link, { to: "/admin/login", className: "btn-glow inline-block mt-6 rounded-full px-6 py-3 font-semibold text-sm", children: "Go to admin sign-in" })
|
|
107
|
+
] });
|
|
108
|
+
}
|
|
109
|
+
if (!roleData?.admin) {
|
|
110
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-md mx-auto pt-24 px-4 text-center glass-strong rounded-3xl p-8", children: [
|
|
111
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Shield, { className: "w-10 h-10 mx-auto text-brand-magenta" }),
|
|
112
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h1", { className: "font-display text-2xl font-bold mt-4", children: "Not an admin yet" }),
|
|
113
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-muted-foreground mt-2", children: [
|
|
114
|
+
"If you're the project owner, claim Master Admin access now. Only the very first user can self-grant — you will receive the master Admin ID",
|
|
115
|
+
" ",
|
|
116
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-foreground font-mono", children: "doraexplora" }),
|
|
117
|
+
"."
|
|
118
|
+
] }),
|
|
119
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: async () => {
|
|
120
|
+
try {
|
|
121
|
+
const res = await grantFn();
|
|
122
|
+
toast.success(`You're the Master Admin! Admin ID: ${res.admin_id}`);
|
|
123
|
+
refetch();
|
|
124
|
+
} catch (e) {
|
|
125
|
+
toast.error(e.message ?? "Failed");
|
|
126
|
+
}
|
|
127
|
+
}, className: "btn-glow mt-6 rounded-full px-6 py-3 font-semibold text-sm", children: "Claim Master Admin access" })
|
|
128
|
+
] });
|
|
129
|
+
}
|
|
130
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx(AdminDashboard, { isMaster: !!roleData.is_master, adminId: roleData.admin_id });
|
|
131
|
+
}
|
|
132
|
+
function AdminDashboard({
|
|
133
|
+
isMaster,
|
|
134
|
+
adminId
|
|
135
|
+
}) {
|
|
136
|
+
const qc = useQueryClient();
|
|
137
|
+
const listFn = useServerFn(listAllProducts);
|
|
138
|
+
const upsertFn = useServerFn(upsertProduct);
|
|
139
|
+
const delFn = useServerFn(deleteProduct);
|
|
140
|
+
const importFn = useServerFn(importProductFromLink);
|
|
141
|
+
const {
|
|
142
|
+
data: products
|
|
143
|
+
} = useQuery({
|
|
144
|
+
queryKey: ["admin-products"],
|
|
145
|
+
queryFn: () => listFn()
|
|
146
|
+
});
|
|
147
|
+
const {
|
|
148
|
+
data: categories
|
|
149
|
+
} = useQuery({
|
|
150
|
+
queryKey: ["cats"],
|
|
151
|
+
queryFn: () => getCategories()
|
|
152
|
+
});
|
|
153
|
+
const [editing, setEditing] = reactExports.useState(null);
|
|
154
|
+
const [tab, setTab] = reactExports.useState("products");
|
|
155
|
+
const upsert = useMutation({
|
|
156
|
+
mutationFn: (data) => upsertFn({
|
|
157
|
+
data
|
|
158
|
+
}),
|
|
159
|
+
onSuccess: () => {
|
|
160
|
+
qc.invalidateQueries({
|
|
161
|
+
queryKey: ["admin-products"]
|
|
162
|
+
});
|
|
163
|
+
qc.invalidateQueries({
|
|
164
|
+
queryKey: ["home"]
|
|
165
|
+
});
|
|
166
|
+
toast.success("Saved");
|
|
167
|
+
setEditing(null);
|
|
168
|
+
},
|
|
169
|
+
onError: (e) => toast.error(e.message ?? "Failed")
|
|
170
|
+
});
|
|
171
|
+
const del = useMutation({
|
|
172
|
+
mutationFn: (id) => delFn({
|
|
173
|
+
data: {
|
|
174
|
+
id
|
|
175
|
+
}
|
|
176
|
+
}),
|
|
177
|
+
onSuccess: () => {
|
|
178
|
+
qc.invalidateQueries({
|
|
179
|
+
queryKey: ["admin-products"]
|
|
180
|
+
});
|
|
181
|
+
toast.success("Deleted");
|
|
182
|
+
}
|
|
183
|
+
});
|
|
184
|
+
const stats = {
|
|
185
|
+
total: products?.length ?? 0,
|
|
186
|
+
trending: products?.filter((p) => p.is_trending).length ?? 0,
|
|
187
|
+
hot: products?.filter((p) => p.is_hot).length ?? 0,
|
|
188
|
+
featured: products?.filter((p) => p.is_featured).length ?? 0,
|
|
189
|
+
views: products?.reduce((s, p) => s + (p.view_count ?? 0), 0) ?? 0
|
|
190
|
+
};
|
|
191
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "max-w-7xl mx-auto px-4 pt-10 pb-20", children: [
|
|
192
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-center justify-between flex-wrap gap-3", children: [
|
|
193
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
194
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("h1", { className: "font-display text-4xl font-bold", children: [
|
|
195
|
+
"Admin ",
|
|
196
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-gradient", children: "dashboard" })
|
|
197
|
+
] }),
|
|
198
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-muted-foreground mt-1 inline-flex items-center gap-2", children: [
|
|
199
|
+
isMaster && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "inline-flex items-center gap-1 text-brand-amber", children: [
|
|
200
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Crown, { className: "w-3.5 h-3.5" }),
|
|
201
|
+
" Master Admin"
|
|
202
|
+
] }),
|
|
203
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { children: [
|
|
204
|
+
"Admin ID: ",
|
|
205
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono text-foreground", children: adminId })
|
|
206
|
+
] })
|
|
207
|
+
] })
|
|
208
|
+
] }),
|
|
209
|
+
tab === "products" && /* @__PURE__ */ jsxRuntimeExports.jsxs("button", { onClick: () => setEditing({}), className: "btn-glow rounded-full px-5 py-2.5 font-semibold text-sm inline-flex items-center gap-2", children: [
|
|
210
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Plus, { className: "w-4 h-4" }),
|
|
211
|
+
" New product"
|
|
212
|
+
] })
|
|
213
|
+
] }),
|
|
214
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-6 inline-flex glass rounded-full p-1 text-sm", children: [
|
|
215
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setTab("products"), className: `px-4 py-1.5 rounded-full transition ${tab === "products" ? "bg-white/10 text-foreground" : "text-muted-foreground"}`, children: "Products" }),
|
|
216
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("button", { onClick: () => setTab("admins"), className: `px-4 py-1.5 rounded-full transition inline-flex items-center gap-1.5 ${tab === "admins" ? "bg-white/10 text-foreground" : "text-muted-foreground"}`, children: [
|
|
217
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(UserPlus, { className: "w-3.5 h-3.5" }),
|
|
218
|
+
" Admins"
|
|
219
|
+
] })
|
|
220
|
+
] }),
|
|
221
|
+
tab === "products" && /* @__PURE__ */ jsxRuntimeExports.jsxs(jsxRuntimeExports.Fragment, { children: [
|
|
222
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 md:grid-cols-5 gap-3 mt-6", children: [
|
|
223
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Stat, { label: "Products", value: stats.total }),
|
|
224
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Stat, { label: "Trending", value: stats.trending, icon: /* @__PURE__ */ jsxRuntimeExports.jsx(TrendingUp, { className: "w-4 h-4 text-brand-magenta" }) }),
|
|
225
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Stat, { label: "Hot deals", value: stats.hot, icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Flame, { className: "w-4 h-4 text-brand-orange" }) }),
|
|
226
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Stat, { label: "Featured", value: stats.featured, icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Star, { className: "w-4 h-4 text-brand-amber" }) }),
|
|
227
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Stat, { label: "Total views", value: stats.views.toLocaleString() })
|
|
228
|
+
] }),
|
|
229
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-10 glass-strong rounded-3xl overflow-hidden", children: [
|
|
230
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-12 px-5 py-3 text-xs text-muted-foreground uppercase tracking-wider border-b border-white/5", children: [
|
|
231
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-span-5", children: "Product" }),
|
|
232
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-span-2", children: "Price" }),
|
|
233
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-span-2", children: "Status" }),
|
|
234
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-span-1", children: "Views" }),
|
|
235
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-span-2 text-right", children: "Actions" })
|
|
236
|
+
] }),
|
|
237
|
+
(products ?? []).map((p) => {
|
|
238
|
+
const openUrl = resolveBuyUrl(p) ?? p.affiliate_url ?? p.product_url ?? p.source_url;
|
|
239
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-12 px-5 py-3 items-center hover:bg-white/5 border-b border-white/5 last:border-none text-sm", children: [
|
|
240
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-5 flex items-center gap-3 min-w-0", children: [
|
|
241
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("img", { src: p.image_url, alt: "", className: "w-10 h-10 rounded-lg object-cover shrink-0" }),
|
|
242
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "truncate", children: [
|
|
243
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-medium truncate", children: p.title }),
|
|
244
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-muted-foreground truncate", children: p.imported_from ?? p.merchant ?? "Shopping site" })
|
|
245
|
+
] })
|
|
246
|
+
] }),
|
|
247
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-2", children: [
|
|
248
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-gradient font-bold", children: [
|
|
249
|
+
"$",
|
|
250
|
+
Number(p.price).toFixed(2)
|
|
251
|
+
] }),
|
|
252
|
+
p.original_price && /* @__PURE__ */ jsxRuntimeExports.jsxs("span", { className: "text-xs text-muted-foreground line-through ml-2", children: [
|
|
253
|
+
"$",
|
|
254
|
+
Number(p.original_price).toFixed(2)
|
|
255
|
+
] })
|
|
256
|
+
] }),
|
|
257
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-2 flex gap-1 flex-wrap", children: [
|
|
258
|
+
p.is_trending && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[10px] bg-brand-magenta/20 text-brand-magenta rounded px-1.5 py-0.5", children: "TREND" }),
|
|
259
|
+
p.is_hot && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[10px] bg-brand-orange/20 text-brand-orange rounded px-1.5 py-0.5", children: "HOT" }),
|
|
260
|
+
p.is_featured && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[10px] bg-brand-amber/20 text-brand-amber rounded px-1.5 py-0.5", children: "FEAT" })
|
|
261
|
+
] }),
|
|
262
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "col-span-1 text-xs text-muted-foreground", children: p.view_count }),
|
|
263
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "col-span-2 flex justify-end gap-1", children: [
|
|
264
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("a", { href: openUrl ?? "#", target: "_blank", rel: "noopener noreferrer", className: "p-2 rounded-lg hover:bg-white/10", title: "Open store link", children: /* @__PURE__ */ jsxRuntimeExports.jsx(ExternalLink, { className: "w-4 h-4" }) }),
|
|
265
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => setEditing(p), className: "p-2 rounded-lg hover:bg-white/10", title: "Edit", children: /* @__PURE__ */ jsxRuntimeExports.jsx(PenLine, { className: "w-4 h-4" }) }),
|
|
266
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: () => confirm("Delete this product?") && del.mutate(p.id), className: "p-2 rounded-lg hover:bg-destructive/20 text-destructive", title: "Delete", children: /* @__PURE__ */ jsxRuntimeExports.jsx(Trash2, { className: "w-4 h-4" }) })
|
|
267
|
+
] })
|
|
268
|
+
] }, p.id);
|
|
269
|
+
}),
|
|
270
|
+
(products ?? []).length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "p-10 text-center text-muted-foreground text-sm", children: "No products yet. Add your first one above." })
|
|
271
|
+
] })
|
|
272
|
+
] }),
|
|
273
|
+
tab === "admins" && /* @__PURE__ */ jsxRuntimeExports.jsx(AdminsPanel, { isMaster }),
|
|
274
|
+
editing && /* @__PURE__ */ jsxRuntimeExports.jsx(EditDialog, { product: editing, categories: categories ?? [], onClose: () => setEditing(null), onSave: (d) => upsert.mutate(d), saving: upsert.isPending, onImport: (url) => importFn({
|
|
275
|
+
data: {
|
|
276
|
+
url
|
|
277
|
+
}
|
|
278
|
+
}), importingLabel: "Import Product From Link" })
|
|
279
|
+
] });
|
|
280
|
+
}
|
|
281
|
+
function AdminsPanel({
|
|
282
|
+
isMaster
|
|
283
|
+
}) {
|
|
284
|
+
const qc = useQueryClient();
|
|
285
|
+
const listFn = useServerFn(listAdmins);
|
|
286
|
+
const createFn = useServerFn(createAdmin);
|
|
287
|
+
const {
|
|
288
|
+
data: admins
|
|
289
|
+
} = useQuery({
|
|
290
|
+
queryKey: ["admins"],
|
|
291
|
+
queryFn: () => listFn()
|
|
292
|
+
});
|
|
293
|
+
const [form, setForm] = reactExports.useState({
|
|
294
|
+
email: "",
|
|
295
|
+
password: "",
|
|
296
|
+
admin_id: ""
|
|
297
|
+
});
|
|
298
|
+
const create = useMutation({
|
|
299
|
+
mutationFn: (data) => createFn({
|
|
300
|
+
data
|
|
301
|
+
}),
|
|
302
|
+
onSuccess: () => {
|
|
303
|
+
toast.success("Admin added");
|
|
304
|
+
qc.invalidateQueries({
|
|
305
|
+
queryKey: ["admins"]
|
|
306
|
+
});
|
|
307
|
+
setForm({
|
|
308
|
+
email: "",
|
|
309
|
+
password: "",
|
|
310
|
+
admin_id: ""
|
|
311
|
+
});
|
|
312
|
+
},
|
|
313
|
+
onError: (e) => toast.error(e.message ?? "Failed")
|
|
314
|
+
});
|
|
315
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-6 grid lg:grid-cols-2 gap-6", children: [
|
|
316
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "glass-strong rounded-3xl p-6", children: [
|
|
317
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("h2", { className: "font-display text-xl font-bold inline-flex items-center gap-2", children: [
|
|
318
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(UserPlus, { className: "w-5 h-5 text-brand-magenta" }),
|
|
319
|
+
" Add new admin"
|
|
320
|
+
] }),
|
|
321
|
+
!isMaster ? /* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-sm text-muted-foreground mt-3", children: [
|
|
322
|
+
"Only the Master Admin can add new admins. Ask the Master Admin (admin ID",
|
|
323
|
+
" ",
|
|
324
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono text-foreground", children: "doraexplora" }),
|
|
325
|
+
") to assign you an Admin ID."
|
|
326
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsxs("form", { onSubmit: (e) => {
|
|
327
|
+
e.preventDefault();
|
|
328
|
+
create.mutate(form);
|
|
329
|
+
}, className: "space-y-3 mt-5", children: [
|
|
330
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FieldRow, { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(KeyRound, { className: "w-4 h-4" }), label: "Assign Admin ID", value: form.admin_id, onChange: (v) => setForm((f) => ({
|
|
331
|
+
...f,
|
|
332
|
+
admin_id: v
|
|
333
|
+
})), placeholder: "e.g. jane_admin" }),
|
|
334
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FieldRow, { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Mail, { className: "w-4 h-4" }), label: "Admin email", type: "email", value: form.email, onChange: (v) => setForm((f) => ({
|
|
335
|
+
...f,
|
|
336
|
+
email: v
|
|
337
|
+
})), placeholder: "admin@company.com" }),
|
|
338
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(FieldRow, { icon: /* @__PURE__ */ jsxRuntimeExports.jsx(Lock, { className: "w-4 h-4" }), label: "Initial password", type: "password", value: form.password, onChange: (v) => setForm((f) => ({
|
|
339
|
+
...f,
|
|
340
|
+
password: v
|
|
341
|
+
})), placeholder: "Min 8 characters" }),
|
|
342
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { disabled: create.isPending || !form.email || !form.password || !form.admin_id, className: "btn-glow w-full rounded-full py-3 font-semibold text-sm disabled:opacity-60", children: create.isPending ? "Creating…" : "Create admin" }),
|
|
343
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-muted-foreground pt-1", children: [
|
|
344
|
+
"The new admin will sign in at ",
|
|
345
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "font-mono", children: "/admin/login" }),
|
|
346
|
+
" using this Admin ID, email, and password."
|
|
347
|
+
] })
|
|
348
|
+
] })
|
|
349
|
+
] }),
|
|
350
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "glass-strong rounded-3xl p-6", children: [
|
|
351
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "font-display text-xl font-bold", children: "Current admins" }),
|
|
352
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-4 divide-y divide-white/5", children: [
|
|
353
|
+
(admins ?? []).map((a) => /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "py-3 flex items-center justify-between gap-3", children: [
|
|
354
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "min-w-0", children: [
|
|
355
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-sm font-medium truncate inline-flex items-center gap-2", children: [
|
|
356
|
+
a.is_master && /* @__PURE__ */ jsxRuntimeExports.jsx(Crown, { className: "w-3.5 h-3.5 text-brand-amber" }),
|
|
357
|
+
a.email ?? "—"
|
|
358
|
+
] }),
|
|
359
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "text-xs text-muted-foreground font-mono", children: a.admin_id ?? "(no admin id)" })
|
|
360
|
+
] }),
|
|
361
|
+
a.is_master && /* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[10px] bg-brand-amber/20 text-brand-amber rounded px-2 py-0.5 uppercase tracking-wider", children: "Master" })
|
|
362
|
+
] }, a.user_id)),
|
|
363
|
+
(admins ?? []).length === 0 && /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "text-sm text-muted-foreground py-4", children: "No admins yet." })
|
|
364
|
+
] })
|
|
365
|
+
] })
|
|
366
|
+
] });
|
|
367
|
+
}
|
|
368
|
+
function FieldRow({
|
|
369
|
+
icon,
|
|
370
|
+
label,
|
|
371
|
+
value,
|
|
372
|
+
onChange,
|
|
373
|
+
placeholder,
|
|
374
|
+
type = "text"
|
|
375
|
+
}) {
|
|
376
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
377
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-xs text-muted-foreground", children: label }),
|
|
378
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-1 flex items-center gap-2 glass rounded-xl px-3 py-2.5", children: [
|
|
379
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-muted-foreground", children: icon }),
|
|
380
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("input", { type, value, onChange: (e) => onChange(e.target.value), placeholder, className: "flex-1 bg-transparent outline-none text-sm placeholder:text-muted-foreground" })
|
|
381
|
+
] })
|
|
382
|
+
] });
|
|
383
|
+
}
|
|
384
|
+
function Stat({
|
|
385
|
+
label,
|
|
386
|
+
value,
|
|
387
|
+
icon
|
|
388
|
+
}) {
|
|
389
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "glass rounded-2xl p-4", children: [
|
|
390
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "text-xs text-muted-foreground inline-flex items-center gap-1", children: [
|
|
391
|
+
icon,
|
|
392
|
+
label
|
|
393
|
+
] }),
|
|
394
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "font-display text-2xl font-bold mt-1", children: value })
|
|
395
|
+
] });
|
|
396
|
+
}
|
|
397
|
+
function EditDialog({
|
|
398
|
+
product,
|
|
399
|
+
categories,
|
|
400
|
+
onClose,
|
|
401
|
+
onSave,
|
|
402
|
+
saving,
|
|
403
|
+
onImport,
|
|
404
|
+
importingLabel
|
|
405
|
+
}) {
|
|
406
|
+
const [form, setForm] = reactExports.useState({
|
|
407
|
+
id: product.id,
|
|
408
|
+
title: product.title ?? "",
|
|
409
|
+
description: product.description ?? "",
|
|
410
|
+
image_url: product.image_url ?? "",
|
|
411
|
+
price: product.price ?? 0,
|
|
412
|
+
original_price: product.original_price ?? null,
|
|
413
|
+
currency: product.currency ?? "USD",
|
|
414
|
+
affiliate_url: product.affiliate_url ?? "",
|
|
415
|
+
product_url: product.product_url ?? "",
|
|
416
|
+
tracking_url: product.tracking_url ?? "",
|
|
417
|
+
source_url: product.source_url ?? "",
|
|
418
|
+
imported_from: product.imported_from ?? "",
|
|
419
|
+
import_notes: product.import_notes ?? "",
|
|
420
|
+
merchant: product.merchant ?? "",
|
|
421
|
+
category_id: product.category_id ?? null,
|
|
422
|
+
tags: product.tags ?? [],
|
|
423
|
+
badges: product.badges ?? [],
|
|
424
|
+
is_trending: product.is_trending ?? false,
|
|
425
|
+
is_hot: product.is_hot ?? false,
|
|
426
|
+
is_featured: product.is_featured ?? false,
|
|
427
|
+
shipping_info: product.shipping_info ?? "",
|
|
428
|
+
delivery_estimate: product.delivery_estimate ?? ""
|
|
429
|
+
});
|
|
430
|
+
const [importUrl, setImportUrl] = reactExports.useState(product.product_url ?? product.source_url ?? product.affiliate_url ?? "");
|
|
431
|
+
const [importing, setImporting] = reactExports.useState(false);
|
|
432
|
+
const [importError, setImportError] = reactExports.useState(null);
|
|
433
|
+
const set = (k, v) => setForm((f) => ({
|
|
434
|
+
...f,
|
|
435
|
+
[k]: v
|
|
436
|
+
}));
|
|
437
|
+
const applyImported = (payload) => {
|
|
438
|
+
setForm((current) => ({
|
|
439
|
+
...current,
|
|
440
|
+
title: payload.title ?? current.title,
|
|
441
|
+
description: payload.description ?? current.description,
|
|
442
|
+
image_url: payload.image_url ?? current.image_url,
|
|
443
|
+
price: payload.price ?? current.price,
|
|
444
|
+
original_price: payload.original_price ?? current.original_price,
|
|
445
|
+
currency: payload.currency ?? current.currency,
|
|
446
|
+
merchant: payload.merchant ?? current.merchant,
|
|
447
|
+
product_url: payload.product_url ?? current.product_url,
|
|
448
|
+
tracking_url: payload.tracking_url ?? current.tracking_url,
|
|
449
|
+
source_url: payload.source_url ?? current.source_url,
|
|
450
|
+
imported_from: payload.imported_from ?? current.imported_from,
|
|
451
|
+
import_notes: payload.import_notes ?? current.import_notes,
|
|
452
|
+
tags: payload.tags ?? current.tags,
|
|
453
|
+
badges: payload.badges ?? current.badges,
|
|
454
|
+
shipping_info: payload.shipping_info ?? current.shipping_info,
|
|
455
|
+
delivery_estimate: payload.delivery_estimate ?? current.delivery_estimate,
|
|
456
|
+
affiliate_url: payload.tracking_url ?? payload.product_url ?? current.affiliate_url
|
|
457
|
+
}));
|
|
458
|
+
if (payload.product_url) setImportUrl(payload.product_url);
|
|
459
|
+
if (payload.import_notes) setImportError(null);
|
|
460
|
+
};
|
|
461
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsx("div", { className: "fixed inset-0 z-50 bg-black/60 backdrop-blur-sm flex items-center justify-center p-4 overflow-y-auto", onClick: onClose, children: /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "glass-strong rounded-3xl p-6 max-w-3xl w-full my-auto", onClick: (e) => e.stopPropagation(), children: [
|
|
462
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex items-start justify-between gap-4 mb-5", children: [
|
|
463
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
464
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("h2", { className: "font-display text-2xl font-bold", children: product.id ? "Edit product" : "New product" }),
|
|
465
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("p", { className: "text-xs text-muted-foreground mt-1 inline-flex items-center gap-1.5", children: [
|
|
466
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Sparkles, { className: "w-3.5 h-3.5 text-brand-magenta" }),
|
|
467
|
+
"Keep the shopping experience clean while still allowing tracking behind the scenes."
|
|
468
|
+
] })
|
|
469
|
+
] }),
|
|
470
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("span", { className: "text-[10px] uppercase tracking-wider bg-white/5 border border-white/10 rounded-full px-3 py-1 text-muted-foreground", children: "Manual + import" })
|
|
471
|
+
] }),
|
|
472
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "rounded-3xl border border-white/10 bg-white/5 p-4 mb-5", children: [
|
|
473
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-col md:flex-row gap-3 md:items-end", children: [
|
|
474
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex-1", children: [
|
|
475
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-xs text-muted-foreground", children: "Import Product From Link" }),
|
|
476
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-1 flex items-center gap-2 glass rounded-xl px-3 py-2.5", children: [
|
|
477
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Link2, { className: "w-4 h-4 text-brand-magenta shrink-0" }),
|
|
478
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("input", { value: importUrl, onChange: (e) => setImportUrl(e.target.value), placeholder: "Paste an AliExpress, Temu, Amazon, eBay, Alibaba, or other store link", className: "flex-1 bg-transparent outline-none text-sm placeholder:text-muted-foreground" })
|
|
479
|
+
] })
|
|
480
|
+
] }),
|
|
481
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("button", { type: "button", disabled: importing || !importUrl.trim(), onClick: async () => {
|
|
482
|
+
try {
|
|
483
|
+
setImporting(true);
|
|
484
|
+
setImportError(null);
|
|
485
|
+
const preview = await onImport(importUrl.trim());
|
|
486
|
+
applyImported(preview);
|
|
487
|
+
toast.success("Imported product details");
|
|
488
|
+
} catch (e) {
|
|
489
|
+
const message = e?.message ?? "Import failed";
|
|
490
|
+
setImportError(message);
|
|
491
|
+
toast.error(message);
|
|
492
|
+
} finally {
|
|
493
|
+
setImporting(false);
|
|
494
|
+
}
|
|
495
|
+
}, className: "btn-glow rounded-full px-5 py-3 font-semibold text-sm inline-flex items-center gap-2 disabled:opacity-60", children: [
|
|
496
|
+
importing ? /* @__PURE__ */ jsxRuntimeExports.jsx(LoaderCircle, { className: "w-4 h-4 animate-spin" }) : /* @__PURE__ */ jsxRuntimeExports.jsx(FileDown, { className: "w-4 h-4" }),
|
|
497
|
+
importing ? "Fetching…" : importingLabel
|
|
498
|
+
] })
|
|
499
|
+
] }),
|
|
500
|
+
importError ? /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "mt-3 text-xs text-destructive inline-flex items-center gap-2", children: [
|
|
501
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(RefreshCw, { className: "w-3.5 h-3.5" }),
|
|
502
|
+
importError
|
|
503
|
+
] }) : /* @__PURE__ */ jsxRuntimeExports.jsx("p", { className: "mt-3 text-xs text-muted-foreground", children: "We’ll try to fetch title, price, description, images, ratings, and source details automatically. You can edit everything before publishing." })
|
|
504
|
+
] }),
|
|
505
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "space-y-3 max-h-[60vh] overflow-y-auto pr-2", children: [
|
|
506
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Inp, { label: "Title", value: form.title, onChange: (v) => set("title", v) }),
|
|
507
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Inp, { label: "Description", value: form.description, onChange: (v) => set("description", v), textarea: true }),
|
|
508
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid md:grid-cols-2 gap-3", children: [
|
|
509
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Inp, { label: "Image URL", value: form.image_url, onChange: (v) => set("image_url", v) }),
|
|
510
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Inp, { label: "Product URL", value: form.product_url, onChange: (v) => set("product_url", v) })
|
|
511
|
+
] }),
|
|
512
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid md:grid-cols-2 gap-3", children: [
|
|
513
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Inp, { label: "Tracking URL", value: form.tracking_url, onChange: (v) => set("tracking_url", v) }),
|
|
514
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Inp, { label: "Source URL", value: form.source_url, onChange: (v) => set("source_url", v) })
|
|
515
|
+
] }),
|
|
516
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid md:grid-cols-2 gap-3", children: [
|
|
517
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Inp, { label: "Affiliate URL", value: form.affiliate_url, onChange: (v) => set("affiliate_url", v) }),
|
|
518
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Inp, { label: "Currency", value: form.currency, onChange: (v) => set("currency", v) })
|
|
519
|
+
] }),
|
|
520
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
521
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Inp, { label: "Price", type: "number", value: form.price, onChange: (v) => set("price", Number(v)) }),
|
|
522
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Inp, { label: "Original price", type: "number", value: form.original_price ?? "", onChange: (v) => set("original_price", v ? Number(v) : null) })
|
|
523
|
+
] }),
|
|
524
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
525
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Inp, { label: "Merchant", value: form.merchant ?? "", onChange: (v) => set("merchant", v) }),
|
|
526
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
527
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-xs text-muted-foreground", children: "Category" }),
|
|
528
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("select", { value: form.category_id ?? "", onChange: (e) => set("category_id", e.target.value || null), className: "w-full glass rounded-xl px-3 py-2.5 text-sm bg-transparent outline-none mt-1", children: [
|
|
529
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: "", children: "— None —" }),
|
|
530
|
+
categories.map((c) => /* @__PURE__ */ jsxRuntimeExports.jsx("option", { value: c.id, className: "bg-background", children: c.name }, c.id))
|
|
531
|
+
] })
|
|
532
|
+
] })
|
|
533
|
+
] }),
|
|
534
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid md:grid-cols-2 gap-3", children: [
|
|
535
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Inp, { label: "Imported from", value: form.imported_from ?? "", onChange: (v) => set("imported_from", v) }),
|
|
536
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Inp, { label: "Import notes", value: form.import_notes ?? "", onChange: (v) => set("import_notes", v) })
|
|
537
|
+
] }),
|
|
538
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "grid grid-cols-2 gap-3", children: [
|
|
539
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Inp, { label: "Shipping info", value: form.shipping_info ?? "", onChange: (v) => set("shipping_info", v) }),
|
|
540
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Inp, { label: "Delivery estimate", value: form.delivery_estimate ?? "", onChange: (v) => set("delivery_estimate", v) })
|
|
541
|
+
] }),
|
|
542
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex flex-wrap gap-4 pt-2", children: [
|
|
543
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Toggle, { label: "Trending", checked: form.is_trending, onChange: (v) => set("is_trending", v) }),
|
|
544
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Toggle, { label: "Hot deal", checked: form.is_hot, onChange: (v) => set("is_hot", v) }),
|
|
545
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx(Toggle, { label: "Featured", checked: form.is_featured, onChange: (v) => set("is_featured", v) })
|
|
546
|
+
] })
|
|
547
|
+
] }),
|
|
548
|
+
/* @__PURE__ */ jsxRuntimeExports.jsxs("div", { className: "flex justify-end gap-2 pt-5 mt-3 border-t border-white/10", children: [
|
|
549
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { onClick: onClose, className: "px-4 py-2 rounded-full text-sm hover:bg-white/5", children: "Cancel" }),
|
|
550
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("button", { disabled: saving, onClick: () => onSave(form), className: "btn-glow rounded-full px-5 py-2 font-semibold text-sm disabled:opacity-60", children: saving ? "Saving…" : "Save" })
|
|
551
|
+
] })
|
|
552
|
+
] }) });
|
|
553
|
+
}
|
|
554
|
+
function Inp({
|
|
555
|
+
label,
|
|
556
|
+
value,
|
|
557
|
+
onChange,
|
|
558
|
+
type = "text",
|
|
559
|
+
textarea
|
|
560
|
+
}) {
|
|
561
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("div", { children: [
|
|
562
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("label", { className: "text-xs text-muted-foreground", children: label }),
|
|
563
|
+
textarea ? /* @__PURE__ */ jsxRuntimeExports.jsx("textarea", { value, onChange: (e) => onChange(e.target.value), rows: 3, className: "w-full glass rounded-xl px-3 py-2 text-sm bg-transparent outline-none mt-1 resize-none" }) : /* @__PURE__ */ jsxRuntimeExports.jsx("input", { type, value, onChange: (e) => onChange(e.target.value), className: "w-full glass rounded-xl px-3 py-2 text-sm bg-transparent outline-none mt-1" })
|
|
564
|
+
] });
|
|
565
|
+
}
|
|
566
|
+
function Toggle({
|
|
567
|
+
label,
|
|
568
|
+
checked,
|
|
569
|
+
onChange
|
|
570
|
+
}) {
|
|
571
|
+
return /* @__PURE__ */ jsxRuntimeExports.jsxs("label", { className: "inline-flex items-center gap-2 text-sm cursor-pointer", children: [
|
|
572
|
+
/* @__PURE__ */ jsxRuntimeExports.jsx("input", { type: "checkbox", checked, onChange: (e) => onChange(e.target.checked), className: "accent-brand-magenta w-4 h-4" }),
|
|
573
|
+
label
|
|
574
|
+
] });
|
|
575
|
+
}
|
|
576
|
+
export {
|
|
577
|
+
AdminPage as component
|
|
578
|
+
};
|