I create a custom plugin and I want this component, do you know if it is available in design-system or elsewhere ?
This topic has been created from a Discord post (1227294548615630898) to give it more visibility.
It will be on Read-Only mode here.
Join the conversation on Discord
After 10 millions hours looking for, I Found the solution. I was digging deep on base code and found this “poor” solution, but works for me. I hope it helps you.
import React from 'react';
import { MediaLibraryInput } from '../../../../../../../node_modules/@strapi/plugin-upload/admin/src/components/MediaLibraryInput';
const Test = () => {
const [selectedFile, setSelectedFile] = React.useState([]);
return (
<MediaLibraryInput name= "my-document" id = 'test' value = { selectedFile } onChange = {(e) => {
console.log('selected file', e.target.value)
setSelectedFile(e.target.value)
}} intlLabel = {{ id: 'my-document', defaultMessage: 'My Document' }} />
);
};
export default Test;
Thank you very much
i’ll try this