mirror of
https://github.com/vercel/commerce.git
synced 2025-05-14 13:47:49 +00:00
17 lines
421 B
TypeScript
17 lines
421 B
TypeScript
'use client';
|
|
|
|
import { getClient } from '@/lib/sanity/sanity.client';
|
|
import { LiveQueryProvider } from '@sanity/preview-kit';
|
|
import { useMemo } from 'react';
|
|
|
|
export default function PreviewProvider({
|
|
children,
|
|
token
|
|
}: {
|
|
children: React.ReactNode;
|
|
token: string;
|
|
}) {
|
|
const client = useMemo(() => getClient({ token }), [token]);
|
|
return <LiveQueryProvider client={client}>{children}</LiveQueryProvider>;
|
|
}
|