|
1 | | -import React, {RefObject, useEffect, useRef, useState} from 'react'; |
| 1 | +import React, {useEffect, useRef, useState} from 'react'; |
2 | 2 | import FileSelectDialog from './FileSelectDialog'; |
3 | 3 |
|
4 | 4 |
|
5 | 5 | export default function FinderFileSelect(props) { |
6 | 6 | const shadowRoot = props.container; |
7 | | - const hostRef = useRef(shadowRoot.host); |
8 | 7 | const baseUrl = props['base-url']; |
9 | 8 | const styleUrl = props['style-url']; |
| 9 | + const mimeTypes = props['mime-types'] ? props['mime-types'].split(',') : []; |
10 | 10 | const selectRef = useRef(null); |
11 | 11 | const slotRef = useRef(null); |
12 | 12 | const dialogRef = useRef(null); |
13 | 13 | const [selectedFile, setSelectedFile] = useState({}); |
14 | 14 | const csrfToken = getCSRFToken(); |
15 | 15 | const uuid5Regex = new RegExp(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i); |
16 | 16 |
|
17 | | - useMutationObserver(hostRef, (mutationList) => { |
18 | | - for (const mutation of mutationList) { |
19 | | - console.log(`The ${mutation.attributeName} attribute was modified.`); |
20 | | - } |
21 | | - }, {attributes: true}); |
22 | | - |
23 | 17 | useEffect(() => { |
24 | 18 | // Create a styles element for the shadow DOM |
25 | 19 | const link = document.createElement('link'); |
@@ -147,6 +141,7 @@ export default function FinderFileSelect(props) { |
147 | 141 | ref={selectRef} |
148 | 142 | realm={props.realm} |
149 | 143 | baseUrl={baseUrl} |
| 144 | + mimeTypes={mimeTypes} |
150 | 145 | csrfToken={csrfToken} |
151 | 146 | selectFile={selectFile} |
152 | 147 | dialogRef={dialogRef} |
|
0 commit comments