23 lines
632 B
TypeScript
23 lines
632 B
TypeScript
'use client';
|
|
|
|
import { useEffect } from 'react';
|
|
import { CartDrawer } from '@/components/store/CartDrawer';
|
|
import { CompareBar } from '@/components/compare/CompareBar';
|
|
import { useCartStore } from '@/store/cartStore';
|
|
|
|
/** Global cart drawer — Sassynest-style: always mounted so Add to Cart can open it from any page. */
|
|
export function StorefrontChrome() {
|
|
useEffect(() => {
|
|
const result = useCartStore.persist.rehydrate();
|
|
void Promise.resolve(result).finally(() => {
|
|
useCartStore.getState().setHasHydrated(true);
|
|
});
|
|
}, []);
|
|
|
|
return (
|
|
<>
|
|
<CartDrawer />
|
|
<CompareBar />
|
|
</>
|
|
);
|
|
}
|