@vendure-platform/create 0.1.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/README.md +70 -0
- package/dist/assets/demo-data/branding/logo.svg +4 -0
- package/dist/assets/demo-data/images/absorbent-pad.webp +0 -0
- package/dist/assets/demo-data/images/adjustable-wrench.webp +0 -0
- package/dist/assets/demo-data/images/anchor-bolt.webp +0 -0
- package/dist/assets/demo-data/images/angle-grinder.webp +0 -0
- package/dist/assets/demo-data/images/barrier-tape.webp +0 -0
- package/dist/assets/demo-data/images/bench-grinder.webp +0 -0
- package/dist/assets/demo-data/images/bracket.webp +0 -0
- package/dist/assets/demo-data/images/broom.webp +0 -0
- package/dist/assets/demo-data/images/bucket.webp +0 -0
- package/dist/assets/demo-data/images/cable-gland.webp +0 -0
- package/dist/assets/demo-data/images/cable-tie.webp +0 -0
- package/dist/assets/demo-data/images/cable-tray.webp +0 -0
- package/dist/assets/demo-data/images/cable.webp +0 -0
- package/dist/assets/demo-data/images/chimney-base-kit.webp +0 -0
- package/dist/assets/demo-data/images/chimney-cowl-bird-guard.webp +0 -0
- package/dist/assets/demo-data/images/chimney-cowl-open.webp +0 -0
- package/dist/assets/demo-data/images/chimney-storm-collar.webp +0 -0
- package/dist/assets/demo-data/images/chimney-wall-bracket.webp +0 -0
- package/dist/assets/demo-data/images/circular-saw.webp +0 -0
- package/dist/assets/demo-data/images/cleaning-spray.webp +0 -0
- package/dist/assets/demo-data/images/conduit.webp +0 -0
- package/dist/assets/demo-data/images/cordless-drill.webp +0 -0
- package/dist/assets/demo-data/images/drill-bits.webp +0 -0
- package/dist/assets/demo-data/images/dust-mask.webp +0 -0
- package/dist/assets/demo-data/images/ear-defenders.webp +0 -0
- package/dist/assets/demo-data/images/ear-plugs.webp +0 -0
- package/dist/assets/demo-data/images/extension-lead.webp +0 -0
- package/dist/assets/demo-data/images/eye-wash-station.webp +0 -0
- package/dist/assets/demo-data/images/face-shield.webp +0 -0
- package/dist/assets/demo-data/images/file-set.webp +0 -0
- package/dist/assets/demo-data/images/first-aid-kit.webp +0 -0
- package/dist/assets/demo-data/images/floor-sign.webp +0 -0
- package/dist/assets/demo-data/images/flue-bend-45.webp +0 -0
- package/dist/assets/demo-data/images/flue-bend-90.webp +0 -0
- package/dist/assets/demo-data/images/flue-section-1000mm.webp +0 -0
- package/dist/assets/demo-data/images/flue-section-250mm.webp +0 -0
- package/dist/assets/demo-data/images/flue-section-500mm.webp +0 -0
- package/dist/assets/demo-data/images/fuse.webp +0 -0
- package/dist/assets/demo-data/images/glove-dispenser.webp +0 -0
- package/dist/assets/demo-data/images/grinding-disc.webp +0 -0
- package/dist/assets/demo-data/images/hacksaw.webp +0 -0
- package/dist/assets/demo-data/images/hammer.webp +0 -0
- package/dist/assets/demo-data/images/hand-sanitiser.webp +0 -0
- package/dist/assets/demo-data/images/head-torch.webp +0 -0
- package/dist/assets/demo-data/images/heat-gun.webp +0 -0
- package/dist/assets/demo-data/images/hex-bolt.webp +0 -0
- package/dist/assets/demo-data/images/hex-key-set.webp +0 -0
- package/dist/assets/demo-data/images/hex-nut.webp +0 -0
- package/dist/assets/demo-data/images/hi-vis-jacket.webp +0 -0
- package/dist/assets/demo-data/images/hi-vis-vest.webp +0 -0
- package/dist/assets/demo-data/images/hose-clamp.webp +0 -0
- package/dist/assets/demo-data/images/impact-driver.webp +0 -0
- package/dist/assets/demo-data/images/jigsaw.webp +0 -0
- package/dist/assets/demo-data/images/junction-box.webp +0 -0
- package/dist/assets/demo-data/images/knee-pads.webp +0 -0
- package/dist/assets/demo-data/images/machine-screw.webp +0 -0
- package/dist/assets/demo-data/images/made-to-order-configurable-chimney.webp +0 -0
- package/dist/assets/demo-data/images/mallet.webp +0 -0
- package/dist/assets/demo-data/images/mcb.webp +0 -0
- package/dist/assets/demo-data/images/mop.webp +0 -0
- package/dist/assets/demo-data/images/paper-towels.webp +0 -0
- package/dist/assets/demo-data/images/pipe-wrench.webp +0 -0
- package/dist/assets/demo-data/images/pliers-set.webp +0 -0
- package/dist/assets/demo-data/images/pry-bar.webp +0 -0
- package/dist/assets/demo-data/images/rcd.webp +0 -0
- package/dist/assets/demo-data/images/reciprocating-saw.webp +0 -0
- package/dist/assets/demo-data/images/rivet.webp +0 -0
- package/dist/assets/demo-data/images/roof-flashing-high-pitch.webp +0 -0
- package/dist/assets/demo-data/images/roof-flashing-low-pitch.webp +0 -0
- package/dist/assets/demo-data/images/safety-boots.webp +0 -0
- package/dist/assets/demo-data/images/safety-glasses.webp +0 -0
- package/dist/assets/demo-data/images/safety-harness.webp +0 -0
- package/dist/assets/demo-data/images/safety-helmet.webp +0 -0
- package/dist/assets/demo-data/images/safety-sign.webp +0 -0
- package/dist/assets/demo-data/images/sanding-disc.webp +0 -0
- package/dist/assets/demo-data/images/saw-blade.webp +0 -0
- package/dist/assets/demo-data/images/screwdriver-set.webp +0 -0
- package/dist/assets/demo-data/images/screwdriver.webp +0 -0
- package/dist/assets/demo-data/images/self-tapping-screw.webp +0 -0
- package/dist/assets/demo-data/images/socket-set.webp +0 -0
- package/dist/assets/demo-data/images/socket.webp +0 -0
- package/dist/assets/demo-data/images/spanner-set.webp +0 -0
- package/dist/assets/demo-data/images/spanner.webp +0 -0
- package/dist/assets/demo-data/images/spill-kit.webp +0 -0
- package/dist/assets/demo-data/images/spirit-level.webp +0 -0
- package/dist/assets/demo-data/images/switch.webp +0 -0
- package/dist/assets/demo-data/images/tape-measure.webp +0 -0
- package/dist/assets/demo-data/images/terminal-block.webp +0 -0
- package/dist/assets/demo-data/images/threaded-rod.webp +0 -0
- package/dist/assets/demo-data/images/torque-wrench.webp +0 -0
- package/dist/assets/demo-data/images/utility-knife.webp +0 -0
- package/dist/assets/demo-data/images/wall-pass-sleeve.webp +0 -0
- package/dist/assets/demo-data/images/wall-plug.webp +0 -0
- package/dist/assets/demo-data/images/washer.webp +0 -0
- package/dist/assets/demo-data/images/waste-bin.webp +0 -0
- package/dist/assets/demo-data/images/wire-connector.webp +0 -0
- package/dist/assets/demo-data/images/wire-cutters.webp +0 -0
- package/dist/assets/demo-data/images/wood-screw.webp +0 -0
- package/dist/assets/demo-data/images/work-gloves.webp +0 -0
- package/dist/assets/demo-data/images/work-light.webp +0 -0
- package/dist/assets/demo-data/initial-data.json +667 -0
- package/dist/assets/demo-data/products.csv +779 -0
- package/dist/assets/storefront/.env.example +14 -0
- package/dist/assets/storefront/.env.local +1 -0
- package/dist/assets/storefront/components.json +22 -0
- package/dist/assets/storefront/eslint.config.mjs +23 -0
- package/dist/assets/storefront/graphql.config.yml +2 -0
- package/dist/assets/storefront/messages/de.json +1196 -0
- package/dist/assets/storefront/messages/en.json +1196 -0
- package/dist/assets/storefront/next-env.d.ts +6 -0
- package/dist/assets/storefront/next.config.ts +73 -0
- package/dist/assets/storefront/package.json +77 -0
- package/dist/assets/storefront/postcss.config.mjs +5 -0
- package/dist/assets/storefront/public/next.svg +22 -0
- package/dist/assets/storefront/public/scenarios/b2b-wholesale/hero/hero-bg.webp +0 -0
- package/dist/assets/storefront/public/scenarios/b2b-wholesale/logo.svg +4 -0
- package/dist/assets/storefront/public/scenarios/default/logo.svg +4 -0
- package/dist/assets/storefront/public/scenarios/kaminpro/hero/hero-bg.webp +0 -0
- package/dist/assets/storefront/public/scenarios/kaminpro/logo.svg +7 -0
- package/dist/assets/storefront/public/vendure.svg +4 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/catalog/page.tsx +65 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/collection/[slug]/loading.tsx +24 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/collection/[slug]/page.tsx +194 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/layout.tsx +9 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/actions.ts +139 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/loading.tsx +46 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/product/[slug]/page.tsx +330 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/actions.ts +11 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/loading.tsx +20 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/page.tsx +97 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-analytics-tracker.tsx +46 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-results.tsx +53 -0
- package/dist/assets/storefront/src/app/[locale]/(catalog)/search/search-term.tsx +26 -0
- package/dist/assets/storefront/src/app/[locale]/(scenario)/[...path]/page.tsx +31 -0
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/accept-invitation-client.tsx +56 -0
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/actions.ts +32 -0
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/page.tsx +85 -0
- package/dist/assets/storefront/src/app/[locale]/accept-invitation/[token]/sign-out-and-retry.tsx +26 -0
- package/dist/assets/storefront/src/app/[locale]/account/addresses/actions.ts +125 -0
- package/dist/assets/storefront/src/app/[locale]/account/addresses/address-form.tsx +180 -0
- package/dist/assets/storefront/src/app/[locale]/account/addresses/addresses-client.tsx +292 -0
- package/dist/assets/storefront/src/app/[locale]/account/addresses/loading.tsx +48 -0
- package/dist/assets/storefront/src/app/[locale]/account/addresses/page.tsx +54 -0
- package/dist/assets/storefront/src/app/[locale]/account/approvals/actions.ts +28 -0
- package/dist/assets/storefront/src/app/[locale]/account/approvals/page.tsx +340 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/actions.ts +33 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/actions.ts +83 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/address-form.tsx +267 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/addresses-client.tsx +253 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/addresses/page.tsx +75 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/actions.ts +70 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/business-unit-form.tsx +153 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/business-units-client.tsx +210 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/page.tsx +66 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/business-units/types.ts +8 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/edit-company-form.tsx +57 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/page.tsx +89 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/payment-methods/page.tsx +65 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/payment-methods/payment-methods-client.tsx +55 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/roles/page.tsx +66 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/roles/roles-client.tsx +93 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/actions.ts +51 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/page.tsx +57 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/tax-ids/tax-ids-client.tsx +326 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/users/actions.ts +74 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/users/edit-user-form.tsx +157 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/users/invite-user-form.tsx +133 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/users/page.tsx +104 -0
- package/dist/assets/storefront/src/app/[locale]/account/company/users/users-client.tsx +266 -0
- package/dist/assets/storefront/src/app/[locale]/account/error.tsx +24 -0
- package/dist/assets/storefront/src/app/[locale]/account/layout.tsx +50 -0
- package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/page.tsx +463 -0
- package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/reorder-actions.ts +160 -0
- package/dist/assets/storefront/src/app/[locale]/account/orders/[code]/reorder-dialog.tsx +386 -0
- package/dist/assets/storefront/src/app/[locale]/account/orders/loading.tsx +45 -0
- package/dist/assets/storefront/src/app/[locale]/account/orders/page.tsx +309 -0
- package/dist/assets/storefront/src/app/[locale]/account/profile/actions.ts +106 -0
- package/dist/assets/storefront/src/app/[locale]/account/profile/change-password-form.tsx +82 -0
- package/dist/assets/storefront/src/app/[locale]/account/profile/edit-email-form.tsx +88 -0
- package/dist/assets/storefront/src/app/[locale]/account/profile/edit-profile-form.tsx +80 -0
- package/dist/assets/storefront/src/app/[locale]/account/profile/loading.tsx +54 -0
- package/dist/assets/storefront/src/app/[locale]/account/profile/page.tsx +44 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/actions.ts +103 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/file-upload-tab.tsx +148 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/manual-entry-tab.tsx +112 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/page.tsx +26 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/preview-table.tsx +170 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/quick-order-form.tsx +243 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/save-to-list-dialog.tsx +153 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/sku-autocomplete.tsx +118 -0
- package/dist/assets/storefront/src/app/[locale]/account/quick-order/text-input-tab.tsx +40 -0
- package/dist/assets/storefront/src/app/[locale]/account/quotes/[id]/page.tsx +260 -0
- package/dist/assets/storefront/src/app/[locale]/account/quotes/actions.ts +253 -0
- package/dist/assets/storefront/src/app/[locale]/account/quotes/new/new-quote-form.tsx +28 -0
- package/dist/assets/storefront/src/app/[locale]/account/quotes/new/page.tsx +51 -0
- package/dist/assets/storefront/src/app/[locale]/account/quotes/page.tsx +248 -0
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/loading.tsx +44 -0
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/page.tsx +51 -0
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/[id]/shopping-list-detail-client.tsx +562 -0
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/actions.ts +235 -0
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/create-shopping-list-form.tsx +86 -0
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/loading.tsx +48 -0
- package/dist/assets/storefront/src/app/[locale]/account/shopping-lists/page.tsx +176 -0
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/actions.ts +31 -0
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/claim-form.tsx +41 -0
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/page.tsx +190 -0
- package/dist/assets/storefront/src/app/[locale]/account/store-credits/reveal-code.tsx +38 -0
- package/dist/assets/storefront/src/app/[locale]/account/verify-email/page.tsx +117 -0
- package/dist/assets/storefront/src/app/[locale]/cart/actions.ts +128 -0
- package/dist/assets/storefront/src/app/[locale]/cart/cart-items.tsx +228 -0
- package/dist/assets/storefront/src/app/[locale]/cart/cart-line-actions.tsx +55 -0
- package/dist/assets/storefront/src/app/[locale]/cart/cart-quantity-control.tsx +158 -0
- package/dist/assets/storefront/src/app/[locale]/cart/cart-remove-button.tsx +36 -0
- package/dist/assets/storefront/src/app/[locale]/cart/cart.tsx +151 -0
- package/dist/assets/storefront/src/app/[locale]/cart/code-input.tsx +49 -0
- package/dist/assets/storefront/src/app/[locale]/cart/loading.tsx +10 -0
- package/dist/assets/storefront/src/app/[locale]/cart/order-summary.tsx +178 -0
- package/dist/assets/storefront/src/app/[locale]/cart/page.tsx +33 -0
- package/dist/assets/storefront/src/app/[locale]/cart/promotion-code.tsx +142 -0
- package/dist/assets/storefront/src/app/[locale]/cart/reapproval-confirm.tsx +76 -0
- package/dist/assets/storefront/src/app/[locale]/cart/request-quote-button.tsx +80 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/actions.ts +192 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/cancel-quote-checkout-button.tsx +30 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/checkout-flow.tsx +214 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/checkout-provider.tsx +181 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/loading.tsx +90 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/order-summary.tsx +160 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/page.tsx +154 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/delivery-step.tsx +107 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/payment-step.tsx +110 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/review-step.tsx +180 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/steps/shipping-address-step.tsx +518 -0
- package/dist/assets/storefront/src/app/[locale]/checkout/types.ts +7 -0
- package/dist/assets/storefront/src/app/[locale]/error.tsx +28 -0
- package/dist/assets/storefront/src/app/[locale]/forgot-password/actions.ts +28 -0
- package/dist/assets/storefront/src/app/[locale]/forgot-password/forgot-password-form.tsx +128 -0
- package/dist/assets/storefront/src/app/[locale]/forgot-password/page.tsx +24 -0
- package/dist/assets/storefront/src/app/[locale]/globals.css +72 -0
- package/dist/assets/storefront/src/app/[locale]/layout.tsx +202 -0
- package/dist/assets/storefront/src/app/[locale]/not-found.tsx +26 -0
- package/dist/assets/storefront/src/app/[locale]/order-confirmation/[code]/order-confirmation.tsx +296 -0
- package/dist/assets/storefront/src/app/[locale]/order-confirmation/[code]/page.tsx +18 -0
- package/dist/assets/storefront/src/app/[locale]/page.tsx +125 -0
- package/dist/assets/storefront/src/app/[locale]/register/actions.ts +50 -0
- package/dist/assets/storefront/src/app/[locale]/register/page.tsx +82 -0
- package/dist/assets/storefront/src/app/[locale]/register/registration-form.tsx +237 -0
- package/dist/assets/storefront/src/app/[locale]/register-company/actions.ts +40 -0
- package/dist/assets/storefront/src/app/[locale]/register-company/page.tsx +43 -0
- package/dist/assets/storefront/src/app/[locale]/register-company/registration-form.tsx +48 -0
- package/dist/assets/storefront/src/app/[locale]/reset-password/actions.ts +40 -0
- package/dist/assets/storefront/src/app/[locale]/reset-password/page.tsx +32 -0
- package/dist/assets/storefront/src/app/[locale]/reset-password/reset-password-form.tsx +96 -0
- package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/add-to-cart-button.tsx +31 -0
- package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/loading.tsx +29 -0
- package/dist/assets/storefront/src/app/[locale]/shopping-list/[code]/page.tsx +157 -0
- package/dist/assets/storefront/src/app/[locale]/sign-in/actions.ts +76 -0
- package/dist/assets/storefront/src/app/[locale]/sign-in/login-form.tsx +177 -0
- package/dist/assets/storefront/src/app/[locale]/sign-in/page.tsx +81 -0
- package/dist/assets/storefront/src/app/[locale]/verify/actions.ts +41 -0
- package/dist/assets/storefront/src/app/[locale]/verify/page.tsx +40 -0
- package/dist/assets/storefront/src/app/[locale]/verify/verify-content.tsx +127 -0
- package/dist/assets/storefront/src/app/[locale]/verify-pending/page.tsx +67 -0
- package/dist/assets/storefront/src/app/api/clear-company-context/route.ts +26 -0
- package/dist/assets/storefront/src/app/api/draft/disable/route.ts +12 -0
- package/dist/assets/storefront/src/app/api/draft/route.ts +17 -0
- package/dist/assets/storefront/src/app/api/revalidate/route.ts +110 -0
- package/dist/assets/storefront/src/app/api/search-analytics/route.ts +16 -0
- package/dist/assets/storefront/src/app/favicon.ico +0 -0
- package/dist/assets/storefront/src/components/commerce/account-nav-items.ts +56 -0
- package/dist/assets/storefront/src/components/commerce/account-sidebar.tsx +112 -0
- package/dist/assets/storefront/src/components/commerce/active-filters.tsx +107 -0
- package/dist/assets/storefront/src/components/commerce/approval-decision-form.tsx +70 -0
- package/dist/assets/storefront/src/components/commerce/approval-status-badge.tsx +37 -0
- package/dist/assets/storefront/src/components/commerce/business-unit-switcher.tsx +56 -0
- package/dist/assets/storefront/src/components/commerce/catalog-search-bar.tsx +83 -0
- package/dist/assets/storefront/src/components/commerce/category-product-section.tsx +69 -0
- package/dist/assets/storefront/src/components/commerce/category-sidebar.tsx +133 -0
- package/dist/assets/storefront/src/components/commerce/collection-hero-banner.tsx +36 -0
- package/dist/assets/storefront/src/components/commerce/company-state-badge.tsx +32 -0
- package/dist/assets/storefront/src/components/commerce/company-switcher.tsx +58 -0
- package/dist/assets/storefront/src/components/commerce/configurator-form.tsx +606 -0
- package/dist/assets/storefront/src/components/commerce/facet-filters.tsx +286 -0
- package/dist/assets/storefront/src/components/commerce/gift-card-pdp.tsx +43 -0
- package/dist/assets/storefront/src/components/commerce/gift-card-product-info.tsx +137 -0
- package/dist/assets/storefront/src/components/commerce/highlighted-text.tsx +30 -0
- package/dist/assets/storefront/src/components/commerce/instant-search-dropdown.tsx +377 -0
- package/dist/assets/storefront/src/components/commerce/order-status-badge.tsx +41 -0
- package/dist/assets/storefront/src/components/commerce/packaging-unit-selector.tsx +146 -0
- package/dist/assets/storefront/src/components/commerce/permission-gate.tsx +20 -0
- package/dist/assets/storefront/src/components/commerce/price-range-filter.tsx +111 -0
- package/dist/assets/storefront/src/components/commerce/price-tiers.tsx +98 -0
- package/dist/assets/storefront/src/components/commerce/price.tsx +29 -0
- package/dist/assets/storefront/src/components/commerce/product-card-list.tsx +121 -0
- package/dist/assets/storefront/src/components/commerce/product-card.tsx +89 -0
- package/dist/assets/storefront/src/components/commerce/product-carousel.tsx +42 -0
- package/dist/assets/storefront/src/components/commerce/product-grid.tsx +54 -0
- package/dist/assets/storefront/src/components/commerce/product-image-carousel.tsx +127 -0
- package/dist/assets/storefront/src/components/commerce/product-info.tsx +525 -0
- package/dist/assets/storefront/src/components/commerce/product-list-expansion.tsx +393 -0
- package/dist/assets/storefront/src/components/commerce/product-list-view.tsx +34 -0
- package/dist/assets/storefront/src/components/commerce/product-sidebar.tsx +175 -0
- package/dist/assets/storefront/src/components/commerce/product-view-switcher.tsx +107 -0
- package/dist/assets/storefront/src/components/commerce/quote-action-buttons.tsx +235 -0
- package/dist/assets/storefront/src/components/commerce/quote-activity-timeline.tsx +320 -0
- package/dist/assets/storefront/src/components/commerce/quote-comment-form.tsx +52 -0
- package/dist/assets/storefront/src/components/commerce/quote-csv-export-button.tsx +97 -0
- package/dist/assets/storefront/src/components/commerce/quote-product-search.tsx +139 -0
- package/dist/assets/storefront/src/components/commerce/quote-request-form.tsx +252 -0
- package/dist/assets/storefront/src/components/commerce/quote-status-badge.tsx +41 -0
- package/dist/assets/storefront/src/components/commerce/quote-validity-indicator.tsx +33 -0
- package/dist/assets/storefront/src/components/commerce/quote-version-comparison.tsx +88 -0
- package/dist/assets/storefront/src/components/commerce/related-products.tsx +56 -0
- package/dist/assets/storefront/src/components/commerce/shop-by-category.tsx +59 -0
- package/dist/assets/storefront/src/components/commerce/shopping-list-toggle.tsx +158 -0
- package/dist/assets/storefront/src/components/commerce/sort-dropdown.tsx +51 -0
- package/dist/assets/storefront/src/components/commerce/store-credit-summary.tsx +45 -0
- package/dist/assets/storefront/src/components/commerce/subcollection-tiles.tsx +56 -0
- package/dist/assets/storefront/src/components/layout/auth-page-shell.tsx +15 -0
- package/dist/assets/storefront/src/components/layout/draft-mode-action.ts +8 -0
- package/dist/assets/storefront/src/components/layout/draft-mode-indicator.tsx +54 -0
- package/dist/assets/storefront/src/components/layout/draft-mode-link.tsx +29 -0
- package/dist/assets/storefront/src/components/layout/footer.tsx +168 -0
- package/dist/assets/storefront/src/components/layout/navbar/actions.ts +33 -0
- package/dist/assets/storefront/src/components/layout/navbar/cart-icon.tsx +50 -0
- package/dist/assets/storefront/src/components/layout/navbar/channel-picker-wrapper.tsx +19 -0
- package/dist/assets/storefront/src/components/layout/navbar/channel-picker.tsx +53 -0
- package/dist/assets/storefront/src/components/layout/navbar/currency-picker-wrapper.tsx +21 -0
- package/dist/assets/storefront/src/components/layout/navbar/currency-picker.tsx +52 -0
- package/dist/assets/storefront/src/components/layout/navbar/language-picker.tsx +51 -0
- package/dist/assets/storefront/src/components/layout/navbar/login-button.tsx +34 -0
- package/dist/assets/storefront/src/components/layout/navbar/mobile-nav.tsx +74 -0
- package/dist/assets/storefront/src/components/layout/navbar/nav-menu-items.tsx +51 -0
- package/dist/assets/storefront/src/components/layout/navbar/navbar-cart.tsx +5 -0
- package/dist/assets/storefront/src/components/layout/navbar/navbar-collections.tsx +291 -0
- package/dist/assets/storefront/src/components/layout/navbar/navbar-link.tsx +28 -0
- package/dist/assets/storefront/src/components/layout/navbar/navbar-user.tsx +147 -0
- package/dist/assets/storefront/src/components/layout/navbar/theme-switcher.tsx +39 -0
- package/dist/assets/storefront/src/components/layout/navbar.tsx +117 -0
- package/dist/assets/storefront/src/components/layout/search-input.tsx +71 -0
- package/dist/assets/storefront/src/components/providers/awaiting-approval-banner.tsx +58 -0
- package/dist/assets/storefront/src/components/providers/cart-count-server.tsx +31 -0
- package/dist/assets/storefront/src/components/providers/company-context-guard.tsx +47 -0
- package/dist/assets/storefront/src/components/providers/company-permissions-server.tsx +14 -0
- package/dist/assets/storefront/src/components/providers/theme-provider.tsx +16 -0
- package/dist/assets/storefront/src/components/shared/breadcrumbs.tsx +39 -0
- package/dist/assets/storefront/src/components/shared/catalog-sidebar-skeleton.tsx +21 -0
- package/dist/assets/storefront/src/components/shared/country-select.tsx +83 -0
- package/dist/assets/storefront/src/components/shared/error-state.tsx +16 -0
- package/dist/assets/storefront/src/components/shared/pagination.tsx +119 -0
- package/dist/assets/storefront/src/components/shared/prefetch-link.tsx +36 -0
- package/dist/assets/storefront/src/components/shared/product-grid-skeleton.tsx +26 -0
- package/dist/assets/storefront/src/components/shared/scenario-paused.tsx +80 -0
- package/dist/assets/storefront/src/components/shared/skeletons/cart-skeleton.tsx +48 -0
- package/dist/assets/storefront/src/components/shared/skeletons/navbar-user-skeleton.tsx +9 -0
- package/dist/assets/storefront/src/components/shared/skeletons/search-input-skeleton.tsx +7 -0
- package/dist/assets/storefront/src/components/shared/skeletons/search-results-skeleton.tsx +17 -0
- package/dist/assets/storefront/src/components/ui/accordion.tsx +66 -0
- package/dist/assets/storefront/src/components/ui/alert-dialog.tsx +157 -0
- package/dist/assets/storefront/src/components/ui/alert.tsx +66 -0
- package/dist/assets/storefront/src/components/ui/aspect-ratio.tsx +11 -0
- package/dist/assets/storefront/src/components/ui/avatar.tsx +53 -0
- package/dist/assets/storefront/src/components/ui/badge.tsx +46 -0
- package/dist/assets/storefront/src/components/ui/breadcrumb.tsx +109 -0
- package/dist/assets/storefront/src/components/ui/button.tsx +58 -0
- package/dist/assets/storefront/src/components/ui/calendar.tsx +213 -0
- package/dist/assets/storefront/src/components/ui/card.tsx +92 -0
- package/dist/assets/storefront/src/components/ui/carousel.tsx +241 -0
- package/dist/assets/storefront/src/components/ui/chart.tsx +357 -0
- package/dist/assets/storefront/src/components/ui/checkbox.tsx +32 -0
- package/dist/assets/storefront/src/components/ui/collapsible.tsx +33 -0
- package/dist/assets/storefront/src/components/ui/command.tsx +184 -0
- package/dist/assets/storefront/src/components/ui/context-menu.tsx +252 -0
- package/dist/assets/storefront/src/components/ui/dialog.tsx +143 -0
- package/dist/assets/storefront/src/components/ui/drawer.tsx +135 -0
- package/dist/assets/storefront/src/components/ui/dropdown-menu.tsx +257 -0
- package/dist/assets/storefront/src/components/ui/empty-state.tsx +37 -0
- package/dist/assets/storefront/src/components/ui/field.tsx +244 -0
- package/dist/assets/storefront/src/components/ui/form.tsx +167 -0
- package/dist/assets/storefront/src/components/ui/hover-card.tsx +44 -0
- package/dist/assets/storefront/src/components/ui/input-otp.tsx +77 -0
- package/dist/assets/storefront/src/components/ui/input.tsx +21 -0
- package/dist/assets/storefront/src/components/ui/kbd-shortcut.tsx +20 -0
- package/dist/assets/storefront/src/components/ui/label.tsx +24 -0
- package/dist/assets/storefront/src/components/ui/menubar.tsx +276 -0
- package/dist/assets/storefront/src/components/ui/navigation-menu.tsx +168 -0
- package/dist/assets/storefront/src/components/ui/pagination.tsx +127 -0
- package/dist/assets/storefront/src/components/ui/popover.tsx +48 -0
- package/dist/assets/storefront/src/components/ui/progress.tsx +31 -0
- package/dist/assets/storefront/src/components/ui/radio-group.tsx +45 -0
- package/dist/assets/storefront/src/components/ui/resizable.tsx +56 -0
- package/dist/assets/storefront/src/components/ui/scroll-area.tsx +58 -0
- package/dist/assets/storefront/src/components/ui/select.tsx +185 -0
- package/dist/assets/storefront/src/components/ui/separator.tsx +28 -0
- package/dist/assets/storefront/src/components/ui/sheet.tsx +139 -0
- package/dist/assets/storefront/src/components/ui/sidebar.tsx +728 -0
- package/dist/assets/storefront/src/components/ui/skeleton.tsx +13 -0
- package/dist/assets/storefront/src/components/ui/slider.tsx +63 -0
- package/dist/assets/storefront/src/components/ui/sonner.tsx +25 -0
- package/dist/assets/storefront/src/components/ui/switch.tsx +31 -0
- package/dist/assets/storefront/src/components/ui/table.tsx +116 -0
- package/dist/assets/storefront/src/components/ui/tabs.tsx +66 -0
- package/dist/assets/storefront/src/components/ui/textarea.tsx +18 -0
- package/dist/assets/storefront/src/components/ui/toggle-group.tsx +73 -0
- package/dist/assets/storefront/src/components/ui/toggle.tsx +47 -0
- package/dist/assets/storefront/src/components/ui/tooltip.tsx +61 -0
- package/dist/assets/storefront/src/config/branding.ts +4 -0
- package/dist/assets/storefront/src/config/scenario-meta.ts +46 -0
- package/dist/assets/storefront/src/config/scenario.ts +313 -0
- package/dist/assets/storefront/src/contexts/auth-context.tsx +35 -0
- package/dist/assets/storefront/src/graphql.ts +14 -0
- package/dist/assets/storefront/src/hooks/use-mobile.ts +19 -0
- package/dist/assets/storefront/src/i18n/locale-utils.ts +33 -0
- package/dist/assets/storefront/src/i18n/locales.ts +18 -0
- package/dist/assets/storefront/src/i18n/navigation.ts +35 -0
- package/dist/assets/storefront/src/i18n/request.ts +19 -0
- package/dist/assets/storefront/src/i18n/routing.ts +19 -0
- package/dist/assets/storefront/src/i18n/server.ts +16 -0
- package/dist/assets/storefront/src/lib/actions/switch-channel.ts +32 -0
- package/dist/assets/storefront/src/lib/actions/switch-currency.ts +25 -0
- package/dist/assets/storefront/src/lib/auth.ts +18 -0
- package/dist/assets/storefront/src/lib/backend-health.ts +38 -0
- package/dist/assets/storefront/src/lib/cart-count-context.tsx +59 -0
- package/dist/assets/storefront/src/lib/cart-guard-utils.ts +10 -0
- package/dist/assets/storefront/src/lib/cart-guard.ts +104 -0
- package/dist/assets/storefront/src/lib/channel-server.ts +28 -0
- package/dist/assets/storefront/src/lib/channel.ts +2 -0
- package/dist/assets/storefront/src/lib/company-context.ts +35 -0
- package/dist/assets/storefront/src/lib/company-permissions-context.tsx +40 -0
- package/dist/assets/storefront/src/lib/currency-server.ts +20 -0
- package/dist/assets/storefront/src/lib/currency.ts +2 -0
- package/dist/assets/storefront/src/lib/format.ts +48 -0
- package/dist/assets/storefront/src/lib/metadata.ts +85 -0
- package/dist/assets/storefront/src/lib/quantity.test.js +20 -0
- package/dist/assets/storefront/src/lib/quantity.ts +20 -0
- package/dist/assets/storefront/src/lib/search-bar-context.tsx +45 -0
- package/dist/assets/storefront/src/lib/search-helpers.ts +69 -0
- package/dist/assets/storefront/src/lib/use-recent-searches.ts +55 -0
- package/dist/assets/storefront/src/lib/utils.ts +6 -0
- package/dist/assets/storefront/src/lib/vendure/actions.ts +96 -0
- package/dist/assets/storefront/src/lib/vendure/api.ts +164 -0
- package/dist/assets/storefront/src/lib/vendure/approval-utils.ts +21 -0
- package/dist/assets/storefront/src/lib/vendure/cached.ts +71 -0
- package/dist/assets/storefront/src/lib/vendure/fragments.ts +213 -0
- package/dist/assets/storefront/src/lib/vendure/instant-search-action.ts +104 -0
- package/dist/assets/storefront/src/lib/vendure/mutations.ts +1136 -0
- package/dist/assets/storefront/src/lib/vendure/queries.ts +1406 -0
- package/dist/assets/storefront/src/middleware.ts +11 -0
- package/dist/assets/storefront/src/scenarios/b2b-wholesale/branding.ts +180 -0
- package/dist/assets/storefront/src/scenarios/b2b-wholesale/hero.tsx +122 -0
- package/dist/assets/storefront/src/scenarios/b2b-wholesale/index.ts +21 -0
- package/dist/assets/storefront/src/scenarios/b2b-wholesale/meta.ts +3 -0
- package/dist/assets/storefront/src/scenarios/default/branding.ts +148 -0
- package/dist/assets/storefront/src/scenarios/default/hero.tsx +107 -0
- package/dist/assets/storefront/src/scenarios/default/index.ts +12 -0
- package/dist/assets/storefront/src/scenarios/default/meta.ts +3 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/auth-gate.tsx +36 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/branding.ts +238 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/cart-items.tsx +359 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/hero.tsx +123 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/index.ts +50 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/meta.ts +9 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/banners.tsx +21 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/bom-basket.tsx +221 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/btn.tsx +38 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/chip.tsx +35 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/config-header.tsx +72 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/field-row.tsx +126 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/info-dot.tsx +38 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/login-notice.tsx +81 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/module-panel.tsx +144 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/quote-dialog.tsx +110 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/schematic.tsx +674 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/components/why-panel.tsx +66 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/configurator-pdp.tsx +43 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/configurator-shell.tsx +320 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/lib/data.ts +150 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/lib/types.ts +30 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/pdp/styles.css +104 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/shop-by-system.tsx +97 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/system-finder/decision-tree.ts +261 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/system-finder/page.tsx +21 -0
- package/dist/assets/storefront/src/scenarios/kaminpro/system-finder/wizard.tsx +600 -0
- package/dist/assets/storefront/src/schema.graphql.placeholder +5 -0
- package/dist/assets/storefront/tsconfig.json +37 -0
- package/dist/assets/templates/CLAUDE.md.hbs +63 -0
- package/dist/assets/templates/README.md.hbs +53 -0
- package/dist/assets/templates/custom-populate.ts.hbs +28 -0
- package/dist/assets/templates/docker-compose.yml.hbs +29 -0
- package/dist/assets/templates/env.hbs +44 -0
- package/dist/assets/templates/environment.d.ts.hbs +32 -0
- package/dist/assets/templates/gitignore.hbs +7 -0
- package/dist/assets/templates/index.ts.hbs +16 -0
- package/dist/assets/templates/npmrc.hbs +1 -0
- package/dist/assets/templates/populate.ts.hbs +27 -0
- package/dist/assets/templates/root-package.json.hbs +17 -0
- package/dist/assets/templates/server-package.json.hbs +31 -0
- package/dist/assets/templates/tsconfig.dashboard.json.hbs +17 -0
- package/dist/assets/templates/tsconfig.root.json.hbs +16 -0
- package/dist/assets/templates/tsconfig.server.json.hbs +20 -0
- package/dist/assets/templates/vendure-config.ts.hbs +80 -0
- package/dist/assets/templates/vite.config.mts.hbs +27 -0
- package/dist/bin/run.d.ts +2 -0
- package/dist/bin/run.js +79 -0
- package/dist/bin/run.js.map +1 -0
- package/dist/cli.d.ts +6 -0
- package/dist/cli.js +154 -0
- package/dist/cli.js.map +1 -0
- package/dist/git-init.d.ts +4 -0
- package/dist/git-init.js +60 -0
- package/dist/git-init.js.map +1 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +13 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin-registry.d.ts +10 -0
- package/dist/plugin-registry.js +485 -0
- package/dist/plugin-registry.js.map +1 -0
- package/dist/scaffolder.d.ts +10 -0
- package/dist/scaffolder.js +218 -0
- package/dist/scaffolder.js.map +1 -0
- package/dist/storefront-copier.d.ts +6 -0
- package/dist/storefront-copier.js +68 -0
- package/dist/storefront-copier.js.map +1 -0
- package/dist/template-renderer.d.ts +30 -0
- package/dist/template-renderer.js +177 -0
- package/dist/template-renderer.js.map +1 -0
- package/dist/types.d.ts +60 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/package.json +48 -0
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import {cacheLife} from 'next/cache';
|
|
2
|
+
import {getTranslations, setRequestLocale} from 'next-intl/server';
|
|
3
|
+
import {getTopCollections} from '@/lib/vendure/cached';
|
|
4
|
+
import {getActiveCustomer} from '@/lib/vendure/actions';
|
|
5
|
+
import {getActiveChannelToken} from '@/lib/channel-server';
|
|
6
|
+
import Image from "next/image";
|
|
7
|
+
import NextLink from "next/link";
|
|
8
|
+
import {Link} from "@/i18n/navigation";
|
|
9
|
+
import { DraftModeLink } from './draft-mode-link';
|
|
10
|
+
import {getBranding} from '@/config/branding';
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
async function Copyright({allRightsReserved}: {allRightsReserved: string}) {
|
|
14
|
+
'use cache'
|
|
15
|
+
cacheLife('days');
|
|
16
|
+
|
|
17
|
+
const { footer } = getBranding();
|
|
18
|
+
return (
|
|
19
|
+
<div>
|
|
20
|
+
© {new Date().getFullYear()} {footer.copyright}. {allRightsReserved}
|
|
21
|
+
</div>
|
|
22
|
+
)
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
async function FooterCollections({locale, channelToken}: {locale: string; channelToken?: string}) {
|
|
26
|
+
'use cache'
|
|
27
|
+
cacheLife('days');
|
|
28
|
+
|
|
29
|
+
const collections = await getTopCollections(locale, channelToken);
|
|
30
|
+
|
|
31
|
+
// Use next/link (not next-intl Link) inside 'use cache' because next-intl's
|
|
32
|
+
// Link reads locale from headers() during SSR, which is forbidden in cache
|
|
33
|
+
// scopes. Construct locale-prefixed hrefs manually instead.
|
|
34
|
+
// See: https://github.com/amannn/next-intl/issues/2229
|
|
35
|
+
return (
|
|
36
|
+
<ul className="space-y-2 text-sm text-muted-foreground">
|
|
37
|
+
{collections.map((collection) => (
|
|
38
|
+
<li key={collection.id}>
|
|
39
|
+
<NextLink
|
|
40
|
+
href={`/${locale}/collection/${collection.slug}`}
|
|
41
|
+
prefetch={false}
|
|
42
|
+
className="hover:text-primary transition-colors"
|
|
43
|
+
>
|
|
44
|
+
{collection.name}
|
|
45
|
+
</NextLink>
|
|
46
|
+
</li>
|
|
47
|
+
))}
|
|
48
|
+
</ul>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function FooterAuthLink({label}: {label: string}) {
|
|
53
|
+
const customer = await getActiveCustomer();
|
|
54
|
+
if (customer) {
|
|
55
|
+
return null;
|
|
56
|
+
}
|
|
57
|
+
return (
|
|
58
|
+
<li>
|
|
59
|
+
<Link href="/sign-in" prefetch={false} className="hover:text-primary transition-colors">
|
|
60
|
+
{label}
|
|
61
|
+
</Link>
|
|
62
|
+
</li>
|
|
63
|
+
);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
export async function Footer({locale}: {locale: string}) {
|
|
67
|
+
setRequestLocale(locale);
|
|
68
|
+
const [t, channelToken] = await Promise.all([
|
|
69
|
+
getTranslations({locale, namespace: 'Footer'}),
|
|
70
|
+
getActiveChannelToken(),
|
|
71
|
+
]);
|
|
72
|
+
const { footer, logo, logoInverted } = getBranding();
|
|
73
|
+
const footerLogo = logoInverted ?? logo;
|
|
74
|
+
return (
|
|
75
|
+
<footer className="bg-muted border-t border-border mt-auto">
|
|
76
|
+
<div className="container mx-auto px-4 py-12">
|
|
77
|
+
<div className="grid grid-cols-2 md:grid-cols-4 gap-8">
|
|
78
|
+
{/* Categories */}
|
|
79
|
+
<div>
|
|
80
|
+
<h4 className="text-sm font-semibold mb-4 text-foreground">{t('categories')}</h4>
|
|
81
|
+
<FooterCollections locale={locale} channelToken={channelToken} />
|
|
82
|
+
</div>
|
|
83
|
+
|
|
84
|
+
{/* Account */}
|
|
85
|
+
<div>
|
|
86
|
+
<h4 className="text-sm font-semibold mb-4 text-foreground">{t('account')}</h4>
|
|
87
|
+
<ul className="space-y-2 text-sm text-muted-foreground">
|
|
88
|
+
<li>
|
|
89
|
+
<Link href="/account/orders" prefetch={false} className="hover:text-primary transition-colors">
|
|
90
|
+
{t('orders')}
|
|
91
|
+
</Link>
|
|
92
|
+
</li>
|
|
93
|
+
<li>
|
|
94
|
+
<Link href="/account/quotes" prefetch={false} className="hover:text-primary transition-colors">
|
|
95
|
+
{t('quotes')}
|
|
96
|
+
</Link>
|
|
97
|
+
</li>
|
|
98
|
+
<li>
|
|
99
|
+
<Link href="/account/company" prefetch={false} className="hover:text-primary transition-colors">
|
|
100
|
+
{t('company')}
|
|
101
|
+
</Link>
|
|
102
|
+
</li>
|
|
103
|
+
<li>
|
|
104
|
+
<Link href="/account/addresses" prefetch={false} className="hover:text-primary transition-colors">
|
|
105
|
+
{t('addresses')}
|
|
106
|
+
</Link>
|
|
107
|
+
</li>
|
|
108
|
+
<li>
|
|
109
|
+
<Link href="/account/profile" prefetch={false} className="hover:text-primary transition-colors">
|
|
110
|
+
{t('profile')}
|
|
111
|
+
</Link>
|
|
112
|
+
</li>
|
|
113
|
+
</ul>
|
|
114
|
+
</div>
|
|
115
|
+
|
|
116
|
+
{/* Customer Service */}
|
|
117
|
+
<div>
|
|
118
|
+
<h4 className="text-sm font-semibold mb-4 text-foreground">{t('customerService')}</h4>
|
|
119
|
+
<ul className="space-y-2 text-sm text-muted-foreground">
|
|
120
|
+
<li>
|
|
121
|
+
<Link href="/search" prefetch={false} className="hover:text-primary transition-colors">
|
|
122
|
+
{t('browseProducts')}
|
|
123
|
+
</Link>
|
|
124
|
+
</li>
|
|
125
|
+
<li>
|
|
126
|
+
<Link href="/register-company" prefetch={false} className="hover:text-primary transition-colors">
|
|
127
|
+
{t('openTradeAccount')}
|
|
128
|
+
</Link>
|
|
129
|
+
</li>
|
|
130
|
+
<FooterAuthLink label={t('signIn')} />
|
|
131
|
+
</ul>
|
|
132
|
+
</div>
|
|
133
|
+
|
|
134
|
+
{/* Powered By */}
|
|
135
|
+
{footer.poweredByLinks && footer.poweredByLinks.length > 0 && (
|
|
136
|
+
<div>
|
|
137
|
+
<h4 className="text-sm font-semibold mb-4 text-foreground">{t('poweredBy')}</h4>
|
|
138
|
+
<ul className="space-y-2 text-sm text-muted-foreground">
|
|
139
|
+
{footer.poweredByLinks.map((link) => (
|
|
140
|
+
<li key={link.href}>
|
|
141
|
+
<a
|
|
142
|
+
href={link.href}
|
|
143
|
+
target="_blank"
|
|
144
|
+
rel="noopener noreferrer"
|
|
145
|
+
className="hover:text-primary transition-colors"
|
|
146
|
+
>
|
|
147
|
+
{link.label}
|
|
148
|
+
</a>
|
|
149
|
+
</li>
|
|
150
|
+
))}
|
|
151
|
+
</ul>
|
|
152
|
+
</div>
|
|
153
|
+
)}
|
|
154
|
+
</div>
|
|
155
|
+
|
|
156
|
+
{/* Bottom bar */}
|
|
157
|
+
<div className="mt-10 pt-6 border-t border-border flex flex-col sm:flex-row justify-between items-center gap-4 text-sm text-muted-foreground">
|
|
158
|
+
<Copyright allRightsReserved={t('allRightsReserved')}/>
|
|
159
|
+
<div className="flex items-center gap-4">
|
|
160
|
+
<DraftModeLink />
|
|
161
|
+
<a href={`${(process.env.VENDURE_SHOP_API_URL ?? 'http://localhost:3500/shop-api').replace(/\/shop-api$/, '')}/dev-mailbox/ui`} target="_blank" rel="noopener noreferrer" className="hover:text-primary transition-colors">{t('demoMailbox')}</a>
|
|
162
|
+
<Image src={footerLogo.src} alt={footerLogo.alt} width={footerLogo.width} height={footerLogo.height} className="h-4 w-auto invert" />
|
|
163
|
+
</div>
|
|
164
|
+
</div>
|
|
165
|
+
</div>
|
|
166
|
+
</footer>
|
|
167
|
+
);
|
|
168
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
'use server';
|
|
2
|
+
|
|
3
|
+
import {readFragment} from '@/graphql';
|
|
4
|
+
import {client} from '@/lib/vendure/api';
|
|
5
|
+
import {SwitchBusinessUnitMutation} from '@/lib/vendure/mutations';
|
|
6
|
+
import {CompanyBusinessUnitFragment} from '@/lib/vendure/fragments';
|
|
7
|
+
import {setCompanyId, setBusinessUnitId, clearBusinessUnitId} from '@/lib/company-context';
|
|
8
|
+
import {revalidatePath, revalidateTag} from 'next/cache';
|
|
9
|
+
|
|
10
|
+
export async function switchBusinessUnitAction(businessUnitId: string) {
|
|
11
|
+
const [result, error] = await client.mutate(
|
|
12
|
+
SwitchBusinessUnitMutation,
|
|
13
|
+
{businessUnitId},
|
|
14
|
+
);
|
|
15
|
+
if (error) throw error;
|
|
16
|
+
|
|
17
|
+
const account = result.data.switchBusinessUnit;
|
|
18
|
+
if (account?.activeBusinessUnit) {
|
|
19
|
+
const activeBu = readFragment(CompanyBusinessUnitFragment, account.activeBusinessUnit);
|
|
20
|
+
await setBusinessUnitId(activeBu.id);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
revalidateTag('active-customer', {expire: 0});
|
|
24
|
+
revalidatePath('/', 'layout');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export async function switchCompanyAction(companyId: string) {
|
|
28
|
+
await setCompanyId(companyId);
|
|
29
|
+
await clearBusinessUnitId();
|
|
30
|
+
|
|
31
|
+
revalidateTag('active-customer', {expire: 0});
|
|
32
|
+
revalidatePath('/', 'layout');
|
|
33
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {Clock, ShoppingCart} from "lucide-react";
|
|
4
|
+
import {Button} from "@/components/ui/button";
|
|
5
|
+
import {Link} from "@/i18n/navigation";
|
|
6
|
+
import {useCartCount} from "@/lib/cart-count-context";
|
|
7
|
+
import {useTranslations} from 'next-intl';
|
|
8
|
+
|
|
9
|
+
export function CartIcon() {
|
|
10
|
+
const t = useTranslations('Navigation');
|
|
11
|
+
const tCart = useTranslations('Cart');
|
|
12
|
+
const {count, awaitingApprovalOrderCode} = useCartCount();
|
|
13
|
+
const display = count > 99 ? '99+' : count;
|
|
14
|
+
|
|
15
|
+
if (awaitingApprovalOrderCode) {
|
|
16
|
+
const label = tCart('orderPendingApproval');
|
|
17
|
+
return (
|
|
18
|
+
<Button variant="ghost" size="icon" asChild className="relative">
|
|
19
|
+
<Link href="/cart" prefetch={false} aria-label={label} title={label}>
|
|
20
|
+
<ShoppingCart className="h-5 w-5 text-muted-foreground"/>
|
|
21
|
+
<span
|
|
22
|
+
className="absolute -top-1 -right-1 bg-amber-500 text-white rounded-full h-4 w-4 flex items-center justify-center"
|
|
23
|
+
aria-hidden
|
|
24
|
+
>
|
|
25
|
+
<Clock className="h-3 w-3"/>
|
|
26
|
+
</span>
|
|
27
|
+
<span className="sr-only">{label}</span>
|
|
28
|
+
</Link>
|
|
29
|
+
</Button>
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<Button variant="ghost" size="icon" asChild className="relative">
|
|
35
|
+
<Link href="/cart" prefetch={false}>
|
|
36
|
+
<ShoppingCart className="h-5 w-5"/>
|
|
37
|
+
{count > 0 && (
|
|
38
|
+
<span
|
|
39
|
+
className={`absolute -top-1 -right-1 bg-primary text-primary-foreground text-xs font-bold rounded-full flex items-center justify-center ${
|
|
40
|
+
count > 99 ? 'min-w-5 h-5 px-1' : 'h-5 w-5'
|
|
41
|
+
}`}
|
|
42
|
+
>
|
|
43
|
+
{display}
|
|
44
|
+
</span>
|
|
45
|
+
)}
|
|
46
|
+
<span className="sr-only">{t('shoppingCart')}</span>
|
|
47
|
+
</Link>
|
|
48
|
+
</Button>
|
|
49
|
+
);
|
|
50
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import {getChannelsConfig} from '@/config/scenario';
|
|
2
|
+
import {getActiveChannelToken} from '@/lib/channel-server';
|
|
3
|
+
import {ChannelPicker} from './channel-picker';
|
|
4
|
+
|
|
5
|
+
export async function ChannelPickerWrapper() {
|
|
6
|
+
const channelsConfig = getChannelsConfig();
|
|
7
|
+
if (!channelsConfig || channelsConfig.available.length <= 1) return null;
|
|
8
|
+
|
|
9
|
+
// Guaranteed non-null: getActiveChannelToken() returns channelsConfig.defaultToken
|
|
10
|
+
// when channelsConfig is set (checked above), so it can never be undefined here.
|
|
11
|
+
const activeToken = (await getActiveChannelToken())!;
|
|
12
|
+
|
|
13
|
+
return (
|
|
14
|
+
<ChannelPicker
|
|
15
|
+
channels={channelsConfig.available}
|
|
16
|
+
activeToken={activeToken}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {useTransition} from 'react';
|
|
4
|
+
import {MapPin} from 'lucide-react';
|
|
5
|
+
import {Button} from '@/components/ui/button';
|
|
6
|
+
import {
|
|
7
|
+
DropdownMenu,
|
|
8
|
+
DropdownMenuContent,
|
|
9
|
+
DropdownMenuItem,
|
|
10
|
+
DropdownMenuTrigger,
|
|
11
|
+
} from '@/components/ui/dropdown-menu';
|
|
12
|
+
import {switchChannel} from '@/lib/actions/switch-channel';
|
|
13
|
+
import type {ChannelOption} from '@/config/scenario';
|
|
14
|
+
|
|
15
|
+
interface ChannelPickerProps {
|
|
16
|
+
channels: ChannelOption[];
|
|
17
|
+
activeToken: string;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function ChannelPicker({channels, activeToken}: ChannelPickerProps) {
|
|
21
|
+
const [isPending, startTransition] = useTransition();
|
|
22
|
+
|
|
23
|
+
const active = channels.find(c => c.token === activeToken) ?? channels[0];
|
|
24
|
+
|
|
25
|
+
function handleSwitch(token: string) {
|
|
26
|
+
startTransition(async () => {
|
|
27
|
+
await switchChannel(token);
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
return (
|
|
32
|
+
<DropdownMenu>
|
|
33
|
+
<DropdownMenuTrigger asChild>
|
|
34
|
+
<Button variant="ghost" size="sm" className="h-9 gap-1 px-2 text-xs font-medium" disabled={isPending}>
|
|
35
|
+
<MapPin className="size-3.5" />
|
|
36
|
+
{active.countryCode}
|
|
37
|
+
<span className="sr-only">Switch country/channel</span>
|
|
38
|
+
</Button>
|
|
39
|
+
</DropdownMenuTrigger>
|
|
40
|
+
<DropdownMenuContent align="end">
|
|
41
|
+
{channels.map((ch) => (
|
|
42
|
+
<DropdownMenuItem
|
|
43
|
+
key={ch.token}
|
|
44
|
+
onClick={() => handleSwitch(ch.token)}
|
|
45
|
+
className={ch.token === activeToken ? 'font-semibold' : undefined}
|
|
46
|
+
>
|
|
47
|
+
{ch.label}
|
|
48
|
+
</DropdownMenuItem>
|
|
49
|
+
))}
|
|
50
|
+
</DropdownMenuContent>
|
|
51
|
+
</DropdownMenu>
|
|
52
|
+
);
|
|
53
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import {getActiveChannelCached} from '@/lib/vendure/cached';
|
|
2
|
+
import {getActiveCurrencyCode} from '@/lib/currency-server';
|
|
3
|
+
import {getActiveChannelToken} from '@/lib/channel-server';
|
|
4
|
+
import {CurrencyPicker} from './currency-picker';
|
|
5
|
+
|
|
6
|
+
export async function CurrencyPickerWrapper() {
|
|
7
|
+
const channelToken = await getActiveChannelToken();
|
|
8
|
+
const [channel, activeCurrency] = await Promise.all([
|
|
9
|
+
getActiveChannelCached(channelToken),
|
|
10
|
+
getActiveCurrencyCode(),
|
|
11
|
+
]);
|
|
12
|
+
|
|
13
|
+
if (channel.availableCurrencyCodes.length <= 1) return null;
|
|
14
|
+
|
|
15
|
+
return (
|
|
16
|
+
<CurrencyPicker
|
|
17
|
+
availableCurrencies={channel.availableCurrencyCodes as string[]}
|
|
18
|
+
activeCurrency={activeCurrency}
|
|
19
|
+
/>
|
|
20
|
+
);
|
|
21
|
+
}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {useTransition} from 'react';
|
|
4
|
+
import {DollarSign} from 'lucide-react';
|
|
5
|
+
import {Button} from '@/components/ui/button';
|
|
6
|
+
import {
|
|
7
|
+
DropdownMenu,
|
|
8
|
+
DropdownMenuContent,
|
|
9
|
+
DropdownMenuItem,
|
|
10
|
+
DropdownMenuTrigger,
|
|
11
|
+
} from '@/components/ui/dropdown-menu';
|
|
12
|
+
import {switchCurrency} from '@/lib/actions/switch-currency';
|
|
13
|
+
|
|
14
|
+
interface CurrencyPickerProps {
|
|
15
|
+
availableCurrencies: string[];
|
|
16
|
+
activeCurrency: string;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export function CurrencyPicker({availableCurrencies, activeCurrency}: CurrencyPickerProps) {
|
|
20
|
+
const [isPending, startTransition] = useTransition();
|
|
21
|
+
|
|
22
|
+
if (availableCurrencies.length <= 1) return null;
|
|
23
|
+
|
|
24
|
+
function handleSwitch(code: string) {
|
|
25
|
+
startTransition(async () => {
|
|
26
|
+
await switchCurrency(code);
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<DropdownMenu>
|
|
32
|
+
<DropdownMenuTrigger asChild>
|
|
33
|
+
<Button variant="ghost" size="sm" className="h-9 gap-1 px-2 text-xs font-medium" disabled={isPending}>
|
|
34
|
+
<DollarSign className="size-3.5" />
|
|
35
|
+
{activeCurrency}
|
|
36
|
+
<span className="sr-only">Switch currency</span>
|
|
37
|
+
</Button>
|
|
38
|
+
</DropdownMenuTrigger>
|
|
39
|
+
<DropdownMenuContent align="end">
|
|
40
|
+
{availableCurrencies.map((code) => (
|
|
41
|
+
<DropdownMenuItem
|
|
42
|
+
key={code}
|
|
43
|
+
onClick={() => handleSwitch(code)}
|
|
44
|
+
className={code === activeCurrency ? 'font-semibold' : undefined}
|
|
45
|
+
>
|
|
46
|
+
{code}
|
|
47
|
+
</DropdownMenuItem>
|
|
48
|
+
))}
|
|
49
|
+
</DropdownMenuContent>
|
|
50
|
+
</DropdownMenu>
|
|
51
|
+
);
|
|
52
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {useLocale} from 'next-intl';
|
|
4
|
+
import {usePathname, useRouter} from '@/i18n/navigation';
|
|
5
|
+
import {routing, localeNames, type Locale} from '@/i18n/routing';
|
|
6
|
+
import {Globe} from 'lucide-react';
|
|
7
|
+
import {Button} from '@/components/ui/button';
|
|
8
|
+
import {
|
|
9
|
+
DropdownMenu,
|
|
10
|
+
DropdownMenuContent,
|
|
11
|
+
DropdownMenuItem,
|
|
12
|
+
DropdownMenuTrigger,
|
|
13
|
+
} from '@/components/ui/dropdown-menu';
|
|
14
|
+
import {useTransition} from 'react';
|
|
15
|
+
|
|
16
|
+
export function LanguagePicker() {
|
|
17
|
+
const locale = useLocale();
|
|
18
|
+
const router = useRouter();
|
|
19
|
+
const pathname = usePathname();
|
|
20
|
+
const [isPending, startTransition] = useTransition();
|
|
21
|
+
|
|
22
|
+
if (routing.locales.length <= 1) return null;
|
|
23
|
+
|
|
24
|
+
function switchLocale(newLocale: Locale) {
|
|
25
|
+
startTransition(() => {
|
|
26
|
+
router.replace({pathname}, {locale: newLocale});
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return (
|
|
31
|
+
<DropdownMenu>
|
|
32
|
+
<DropdownMenuTrigger asChild>
|
|
33
|
+
<Button variant="ghost" size="icon" className="h-9 w-9" disabled={isPending}>
|
|
34
|
+
<Globe className="size-4" />
|
|
35
|
+
<span className="sr-only">Switch language</span>
|
|
36
|
+
</Button>
|
|
37
|
+
</DropdownMenuTrigger>
|
|
38
|
+
<DropdownMenuContent align="end">
|
|
39
|
+
{routing.locales.map((loc) => (
|
|
40
|
+
<DropdownMenuItem
|
|
41
|
+
key={loc}
|
|
42
|
+
onClick={() => switchLocale(loc)}
|
|
43
|
+
className={loc === locale ? 'font-semibold' : undefined}
|
|
44
|
+
>
|
|
45
|
+
{localeNames[loc]}
|
|
46
|
+
</DropdownMenuItem>
|
|
47
|
+
))}
|
|
48
|
+
</DropdownMenuContent>
|
|
49
|
+
</DropdownMenu>
|
|
50
|
+
);
|
|
51
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
'use client'
|
|
2
|
+
|
|
3
|
+
import {ComponentProps, useTransition} from "react";
|
|
4
|
+
import {useTranslations} from 'next-intl';
|
|
5
|
+
import {logoutAction} from "@/app/[locale]/sign-in/actions";
|
|
6
|
+
import {useRouter} from "@/i18n/navigation";
|
|
7
|
+
|
|
8
|
+
interface LoginButtonProps extends ComponentProps<'button'> {
|
|
9
|
+
isLoggedIn: boolean;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export function LoginButton({isLoggedIn, ...props}: LoginButtonProps) {
|
|
13
|
+
const t = useTranslations('Navigation');
|
|
14
|
+
const [isPending, startTransition] = useTransition();
|
|
15
|
+
const router = useRouter();
|
|
16
|
+
|
|
17
|
+
return (
|
|
18
|
+
<button {...props} aria-disabled={isPending}
|
|
19
|
+
onClick={() => {
|
|
20
|
+
if (isLoggedIn) {
|
|
21
|
+
startTransition(async () => {
|
|
22
|
+
const result = await logoutAction();
|
|
23
|
+
if (result?.redirectTo) {
|
|
24
|
+
router.replace(result.redirectTo);
|
|
25
|
+
}
|
|
26
|
+
})
|
|
27
|
+
} else {
|
|
28
|
+
router.push('/sign-in')
|
|
29
|
+
}
|
|
30
|
+
}}>
|
|
31
|
+
{isLoggedIn ? t('signOut') : t('signIn')}
|
|
32
|
+
</button>
|
|
33
|
+
)
|
|
34
|
+
}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import {useState} from 'react';
|
|
4
|
+
import {useTranslations} from 'next-intl';
|
|
5
|
+
import {Menu, Search} from 'lucide-react';
|
|
6
|
+
import {Button} from '@/components/ui/button';
|
|
7
|
+
import {Sheet, SheetContent, SheetHeader, SheetTitle, SheetTrigger} from '@/components/ui/sheet';
|
|
8
|
+
import {Input} from '@/components/ui/input';
|
|
9
|
+
import {Link, useRouter} from '@/i18n/navigation';
|
|
10
|
+
|
|
11
|
+
interface NavLink {
|
|
12
|
+
href: string;
|
|
13
|
+
label: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export function MobileNav({ navLinks }: { navLinks: NavLink[] }) {
|
|
17
|
+
const t = useTranslations('Navigation');
|
|
18
|
+
const [open, setOpen] = useState(false);
|
|
19
|
+
const [searchValue, setSearchValue] = useState('');
|
|
20
|
+
const router = useRouter();
|
|
21
|
+
|
|
22
|
+
const handleSearch = (e: React.FormEvent) => {
|
|
23
|
+
e.preventDefault();
|
|
24
|
+
if (!searchValue.trim()) return;
|
|
25
|
+
router.push(`/search?q=${encodeURIComponent(searchValue.trim())}`);
|
|
26
|
+
setOpen(false);
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
const handleLinkClick = () => {
|
|
30
|
+
setOpen(false);
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
return (
|
|
34
|
+
<Sheet open={open} onOpenChange={setOpen}>
|
|
35
|
+
<SheetTrigger asChild>
|
|
36
|
+
<Button variant="ghost" size="icon" className="h-9 w-9" aria-label={t('openMenu')}>
|
|
37
|
+
<Menu className="size-5" />
|
|
38
|
+
</Button>
|
|
39
|
+
</SheetTrigger>
|
|
40
|
+
<SheetContent side="left" className="w-80 bg-muted p-0">
|
|
41
|
+
<SheetHeader className="px-4 pt-4 pb-3 border-b border-border">
|
|
42
|
+
<SheetTitle className="text-left text-foreground">{t('menu')}</SheetTitle>
|
|
43
|
+
</SheetHeader>
|
|
44
|
+
<div className="flex flex-col h-full">
|
|
45
|
+
<form onSubmit={handleSearch} className="p-4 border-b border-border">
|
|
46
|
+
<div className="relative">
|
|
47
|
+
<Search className="absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground" />
|
|
48
|
+
<Input
|
|
49
|
+
type="search"
|
|
50
|
+
placeholder={t('searchProducts')}
|
|
51
|
+
className="pl-9 bg-input"
|
|
52
|
+
value={searchValue}
|
|
53
|
+
onChange={(e) => setSearchValue(e.target.value)}
|
|
54
|
+
/>
|
|
55
|
+
</div>
|
|
56
|
+
</form>
|
|
57
|
+
<nav className="flex-1 overflow-y-auto py-2">
|
|
58
|
+
{navLinks.map(({href, label}) => (
|
|
59
|
+
<Link
|
|
60
|
+
key={href}
|
|
61
|
+
href={href}
|
|
62
|
+
prefetch={false}
|
|
63
|
+
onClick={handleLinkClick}
|
|
64
|
+
className="flex items-center px-4 py-2.5 text-sm text-foreground hover:bg-accent transition-colors"
|
|
65
|
+
>
|
|
66
|
+
{label}
|
|
67
|
+
</Link>
|
|
68
|
+
))}
|
|
69
|
+
</nav>
|
|
70
|
+
</div>
|
|
71
|
+
</SheetContent>
|
|
72
|
+
</Sheet>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
'use client';
|
|
2
|
+
|
|
3
|
+
import { personalNavItems, getVisibleCompanyItems } from '@/components/commerce/account-nav-items';
|
|
4
|
+
import {
|
|
5
|
+
DropdownMenuGroup,
|
|
6
|
+
DropdownMenuItem,
|
|
7
|
+
DropdownMenuLabel,
|
|
8
|
+
DropdownMenuSeparator,
|
|
9
|
+
} from '@/components/ui/dropdown-menu';
|
|
10
|
+
import { Link } from '@/i18n/navigation';
|
|
11
|
+
import { useTranslations } from 'next-intl';
|
|
12
|
+
|
|
13
|
+
export function PersonalNavMenuItems() {
|
|
14
|
+
const t = useTranslations('Navigation');
|
|
15
|
+
return (
|
|
16
|
+
<DropdownMenuGroup>
|
|
17
|
+
{personalNavItems.map(item => (
|
|
18
|
+
<DropdownMenuItem key={item.href} asChild>
|
|
19
|
+
<Link href={item.href} prefetch={false}>
|
|
20
|
+
<item.icon className="mr-2 h-4 w-4" />
|
|
21
|
+
{t(item.label as Parameters<typeof t>[0])}
|
|
22
|
+
</Link>
|
|
23
|
+
</DropdownMenuItem>
|
|
24
|
+
))}
|
|
25
|
+
</DropdownMenuGroup>
|
|
26
|
+
);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export function CompanyNavMenuItems({ permissions }: { permissions: string[] }) {
|
|
30
|
+
const t = useTranslations('Navigation');
|
|
31
|
+
const items = getVisibleCompanyItems(permissions);
|
|
32
|
+
if (items.length === 0) return null;
|
|
33
|
+
return (
|
|
34
|
+
<>
|
|
35
|
+
<DropdownMenuSeparator />
|
|
36
|
+
<DropdownMenuLabel className="text-xs text-muted-foreground">
|
|
37
|
+
{t('company')}
|
|
38
|
+
</DropdownMenuLabel>
|
|
39
|
+
<DropdownMenuGroup>
|
|
40
|
+
{items.map(item => (
|
|
41
|
+
<DropdownMenuItem key={item.href} asChild>
|
|
42
|
+
<Link href={item.href} prefetch={false}>
|
|
43
|
+
<item.icon className="mr-2 h-4 w-4" />
|
|
44
|
+
{t(item.label as Parameters<typeof t>[0])}
|
|
45
|
+
</Link>
|
|
46
|
+
</DropdownMenuItem>
|
|
47
|
+
))}
|
|
48
|
+
</DropdownMenuGroup>
|
|
49
|
+
</>
|
|
50
|
+
);
|
|
51
|
+
}
|