import React from 'react'; import {Loader} from 'lucide-react'; import Modal from '@ui/Modal'; const DataSelectorModal = ({ isOpen, onClose, isLoading, availableData = {profiles: [], customFormats: []}, selectedData = {profiles: [], customFormats: []}, onDataToggle, error }) => { // Ensure we have safe defaults for selectedData const profiles = selectedData?.profiles || []; const customFormats = selectedData?.customFormats || []; return (
{isLoading ? (
) : ( <> {/* Quality Profiles Section */}

Quality Profiles

{profiles.length} selected
{(availableData?.profiles || []).map( profile => ( ) )}
{/* Custom Formats Section */}

Custom Formats

{customFormats.length} selected

Note: Custom formats used in selected quality profiles are automatically imported and don't need to be selected here.

{(availableData?.customFormats || []).map( format => ( ) )}
{error && (

{error}

)} )}
); }; export default DataSelectorModal;