11'use client' ;
22
3- import { SlotContent , VersionedSlotId , VersionedSlotMap } from '@croct/plug/slot' ;
3+ import { DynamicSlotId , SlotContent , VersionedSlotId , VersionedSlotMap } from '@croct/plug/slot' ;
44import { JsonObject } from '@croct/plug/sdk/json' ;
55import { FetchOptions } from '@croct/plug/plug' ;
66import { useEffect , useMemo , useState } from 'react' ;
@@ -40,10 +40,10 @@ function useCsrContent<I, F, O extends FetchResponseOptions>(
4040 ( ) => getSlotContent ( id , normalizedLocale ) as SlotContent | null ?? undefined ,
4141 [ id , normalizedLocale ] ,
4242 ) ;
43- const fallback = fallbackContent === undefined ? defaultContent : fallbackContent ;
43+ const fallback = ( fallbackContent === undefined ? defaultContent : fallbackContent ) as SlotContent ;
4444 const [ initial , setInitial ] = useState (
4545 ( ) => {
46- const content = initialContent === undefined ? defaultContent : initialContent ;
46+ const content = ( initialContent === undefined ? defaultContent : initialContent ) ;
4747
4848 if ( content === undefined ) {
4949 return undefined ;
@@ -62,7 +62,7 @@ function useCsrContent<I, F, O extends FetchResponseOptions>(
6262 + `:${ normalizedLocale ?? '' } `
6363 + `:${ JSON . stringify ( fetchOptions ?. attributes ?? { } ) } ` ,
6464 ) ,
65- loader : ( ) => croct . fetch < VersionedSlotId , FetchResponseOptions > ( id , {
65+ loader : ( ) => croct . fetch < DynamicSlotId , FetchResponseOptions > ( id , {
6666 ...fetchOptions ,
6767 ...( normalizedLocale !== undefined ? { preferredLocale : normalizedLocale } : { } ) ,
6868 ...( fallback !== undefined ? { fallback : fallback } : { } ) ,
0 commit comments