import { verifyAccept } from '@morev/utils';
const ACCEPT = 'image/*, .pdf';
const onFilesChange = (event) => {
const verifiedFiles = [...event.target?.files || []]
.filter((file) => verifyAccept(file.type, ACCEPT));
// Делаете с ними, что вам там нужно
}
dropZone.addEventListener('dragenter', (event) => {
const item = event.dataTransfer.items[0];
const type = item.type;
// Check if the item type matches the filter criteria
if (type === 'image/png' || type === 'image/jpeg') {
// Allow the item to be dropped
dropZone.classList.add('drag-over');
} else {
// Prevent the item from being dropped
event.preventDefault();
}
});