1- import React from ' react' ;
2- import prefixFileUrlWithBackendUrl from ' ../utils/prefixFileUrlWithBackendUrl' ;
3- import { useStrapiApp } from ' @strapi/strapi/admin' ;
4- import type { Schema } from ' @strapi/types' ;
1+ import React from " react" ;
2+ import prefixFileUrlWithBackendUrl from " ../utils/prefixFileUrlWithBackendUrl" ;
3+ import { useStrapiApp } from " @strapi/strapi/admin" ;
4+ import type { Schema } from " @strapi/types" ;
55
66const MediaLibComponent : React . FC < any > = ( {
77 isOpen = false ,
88 onChange,
99 onToggle,
10- allowedTypes
10+ allowedTypes,
1111} ) => {
12-
13- const components = useStrapiApp ( 'ImageDialog' , ( state ) => state . components ) ;
12+ const components = useStrapiApp ( "ImageDialog" , ( state ) => state . components ) ;
1413 if ( ! components || ! isOpen ) return null ;
1514
16- const MediaLibraryDialog = components [ 'media-library' ] as React . ComponentType < {
15+ const MediaLibraryDialog : any = components [
16+ "media-library"
17+ ] as React . ComponentType < {
1718 allowedTypes ?: Schema . Attribute . MediaKind [ ] ; // 'images' | 'videos' | 'files' | 'audios'
1819 onClose : ( ) => void ;
1920 onSelectAssets : ( _images : Schema . Attribute . MediaValue < true > ) => void ;
2021 } > ;
2122
22-
2323 const handleSelectAssets = ( assets : Schema . Attribute . MediaValue < true > ) => {
2424 const formattedFiles = assets . map ( ( f ) => ( {
2525 alt : f . alternativeText || f . name ,
@@ -39,9 +39,9 @@ const MediaLibComponent: React.FC<any> = ({
3939
4040 return (
4141 < MediaLibraryDialog
42- allowedTypes = { allowedTypes }
43- onClose = { onToggle }
44- onSelectAssets = { handleSelectAssets }
42+ allowedTypes = { allowedTypes }
43+ onClose = { onToggle }
44+ onSelectAssets = { handleSelectAssets }
4545 />
4646 ) ;
4747} ;
0 commit comments