import { observer } from 'mobx-react-lite' ; import styled , { css } from 'reshadow' ; import { Loader } from '@cloudbeaver/core-blocks' ; import { CommonDialogWrapper } from '@cloudbeaver/core-dialogs' ; import type { IDriver } from './Driver' ; import { DriverSelector } from './DriverSelector' ; const styles = css `
  DriverSelector {
    flex: 1;
  }
` ; interface IProps { title : string ; drivers : IDriver [ ] ; isLoading : boolean ; onSelect : ( driverId : string ) => void ; onClose : ( ) => void ; } export const DriverSelectorDialog = observer < IProps > ( function DriverSelectorDialog ( { title , drivers , isLoading , onSelect , onClose , } ) { return styled ( styles ) ( < CommonDialogWrapper size = 'large' title = { title } fixedSize noBodyPadding noOverflow onReject = { onClose } > { isLoading && < Loader />} { ! isLoading && < DriverSelector drivers = { drivers } onSelect = { onSelect } / > } < /CommonDialogWrapper>); } ) ;