iterative/vscode-dvc

View on GitHub
webview/src/plots/components/emptyState/EmptyState.tsx

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import React from 'react'
import styles from './styles.module.scss'
import { CustomPlotsWrapper } from '../customPlots/CustomPlotsWrapper'
import { EmptyState as SharedEmptyState } from '../../../shared/components/emptyState/EmptyState'

export const EmptyState: React.FC<{
  hasCustomPlots: boolean
  modal: React.ReactNode
  children: React.ReactNode
}> = ({ children, hasCustomPlots, modal }) => (
  <div className={styles.emptyStateWrapper}>
    <SharedEmptyState isFullScreen={!hasCustomPlots}>
      {children}
    </SharedEmptyState>
    {hasCustomPlots && (
      <>
        <CustomPlotsWrapper />
        {modal}
      </>
    )}
  </div>
)