import { CoreSetup } from 'kibana/public' ; import React from 'react' ; import { ReportingAPIClient } from '../' ; import { PDF_REPORT_TYPE , PDF_REPORT_TYPE_V2 , PNG_REPORT_TYPE_V2 } from '../../common/constants' ; import type { Props as PanelPropsScreenCapture } from '../share_context_menu/screen_capture_panel_content' ; import { ScreenCapturePanelContent } from '../share_context_menu/screen_capture_panel_content_lazy' ; interface IncludeOnCloseFn { onClose : ( ) => void ; } type Props = Pick < PanelPropsScreenCapture , 'getJobParams' | 'layoutOption' | 'objectId' > & IncludeOnCloseFn ; export function getSharedComponents ( core , apiClient ) { return { ReportingPanelPDF ( props ) { return ( < ScreenCapturePanelContent layoutOption = { props . layoutOption } requiresSavedState = { false } reportType = { PDF_REPORT_TYPE } apiClient = { apiClient } toasts = { core . notifications . toasts } uiSettings = { core . uiSettings } theme = { core . theme } { ... props } / > ) ; } , ReportingPanelPDFV2 ( props ) { return ( < ScreenCapturePanelContent layoutOption = { props . layoutOption } requiresSavedState = { false } reportType = { PDF_REPORT_TYPE_V2 } apiClient = { apiClient } toasts = { core . notifications . toasts } uiSettings = { core . uiSettings } theme = { core . theme } { ... props } />); } , ReportingPanelPNGV2 ( props ) { return ( < ScreenCapturePanelContent layoutOption = { props . layoutOption } requiresSavedState = { false } reportType = { PNG_REPORT_TYPE_V2 } apiClient = { apiClient } toasts = { core . notifications . toasts } uiSettings = { core . uiSettings } theme = { core . theme } { ... props } />); } , } ; }