|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import React, { useState } from 'react'; |
|
|
import { ConvertDBDialog, ConvertOptions } from './ConvertDBDialog'; |
|
|
import { MdxProfile } from '../types'; |
|
|
|
|
|
interface ConvertDBDialogWrapperProps { |
|
|
profile: MdxProfile; |
|
|
initialOptions: ConvertOptions; |
|
|
onOptionsReady: (options: ConvertOptions) => void; |
|
|
isProfileInUse?: boolean; |
|
|
} |
|
|
|
|
|
export const ConvertDBDialogWrapper: React.FC<ConvertDBDialogWrapperProps> = ({ |
|
|
profile, |
|
|
initialOptions, |
|
|
onOptionsReady, |
|
|
isProfileInUse = false, |
|
|
}) => { |
|
|
const [options, setOptions] = useState<ConvertOptions>(initialOptions); |
|
|
|
|
|
|
|
|
React.useEffect(() => { |
|
|
onOptionsReady(options); |
|
|
}, [options, onOptionsReady]); |
|
|
|
|
|
return ( |
|
|
<ConvertDBDialog |
|
|
profile={profile} |
|
|
options={options} |
|
|
onOptionsChange={setOptions} |
|
|
isProfileInUse={isProfileInUse} |
|
|
/> |
|
|
); |
|
|
}; |
|
|
|
|
|
|