@@ -107,8 +107,8 @@ export const ActionSelector: React.FC<ActionSelectorProps> = ({ open, onClose, o
107107 const totalSeconds = section . children ?. reduce ( ( sum , action ) => sum + ( action . seconds || 0 ) , 0 ) || 0 ;
108108 const path = mode === "browse" ? browser . currentPath : contentPath ;
109109 const contentPathStr = generatePath ( pathIndices ) ;
110- const embedUrl = section . embedUrl ;
111- onSelect ( sectionId , sectionName , totalSeconds , provId , "providerSection" , undefined , embedUrl , path , contentPathStr ) ;
110+ const downloadUrl = section . downloadUrl ;
111+ onSelect ( sectionId , sectionName , totalSeconds , provId , "providerSection" , section . thumbnail , downloadUrl , path , contentPathStr ) ;
112112 onClose ( ) ;
113113 } , [ onSelect , onClose , mode , browser . currentPath , contentPath ] ) ;
114114
@@ -118,21 +118,26 @@ export const ActionSelector: React.FC<ActionSelectorProps> = ({ open, onClose, o
118118 const actionName = action . label || "Action" ;
119119 const path = mode === "browse" ? browser . currentPath : contentPath ;
120120 const contentPathStr = generatePath ( pathIndices ) ;
121- let embedUrl = action . embedUrl ;
122- if ( ! embedUrl && action . children && action . children . length > 0 ) {
123- const childWithUrl = action . children . find ( child => child . embedUrl ) ;
124- if ( childWithUrl ) embedUrl = childWithUrl . embedUrl ;
121+ let downloadUrl = action . downloadUrl ;
122+ if ( ! downloadUrl && action . children && action . children . length > 0 ) {
123+ const childWithUrl = action . children . find ( child => child . downloadUrl ) ;
124+ if ( childWithUrl ) downloadUrl = childWithUrl . downloadUrl ;
125125 }
126- onSelect ( actionId , actionName , action . seconds , provId , "providerPresentation" , undefined , embedUrl , path , contentPathStr ) ;
126+ let thumbnail = action . thumbnail ;
127+ if ( ! thumbnail && action . children && action . children . length > 0 ) {
128+ const childWithThumbnail = action . children . find ( ( child : InstructionItem ) => child . thumbnail ) ;
129+ if ( childWithThumbnail ) thumbnail = childWithThumbnail . thumbnail ;
130+ }
131+ onSelect ( actionId , actionName , action . seconds , provId , "providerPresentation" , thumbnail , downloadUrl , path , contentPathStr ) ;
127132 onClose ( ) ;
128133 } , [ onSelect , onClose , mode , browser . currentPath , contentPath ] ) ;
129134
130135 // Handle adding a file
131136 const handleAddFile = useCallback ( ( file : ContentFile , provId : string , pathIndices ?: number [ ] ) => {
132- const embedUrl = file . embedUrl || file . url ;
137+ const downloadUrl = file . downloadUrl || file . url ;
133138 const path = mode === "browse" ? browser . currentPath : contentPath ;
134139 const contentPathStr = pathIndices ? generatePath ( pathIndices ) : undefined ;
135- onSelect ( file . id , file . title , file . seconds , provId , "providerFile" , file . image , embedUrl , path , contentPathStr ) ;
140+ onSelect ( file . id , file . title , file . seconds , provId , "providerFile" , file . thumbnail , downloadUrl , path , contentPathStr ) ;
136141 onClose ( ) ;
137142 } , [ onSelect , onClose , mode , browser . currentPath , contentPath ] ) ;
138143
0 commit comments