import {PlugConnection} from '@gravity-ui/icons'; import {ActionTooltip, Button, ClipboardButton, Flex, Icon} from '@gravity-ui/uikit'; import {getConnectToDBDialog} from '../../components/ConnectToDB/ConnectToDBDialog'; import {ServerlessDBLabel} from '../../components/ServerlessDBLabel/ServerlessDBLabel'; import type {PreparedTenant} from '../../store/reducers/tenants/types'; import {useDatabaseHealthcheckAvailable} from '../../utils/hooks/useDatabaseHealthcheckAvailable'; import {HealthcheckPreview} from '../Tenant/Diagnostics/TenantOverview/Healthcheck/HealthcheckPreview'; import {b} from './constants'; import {headerKeyset} from './i18n'; interface HeaderLeftControlsProps { database: string; databaseData?: PreparedTenant; isDatabaseDataLoading: boolean; } export function HeaderLeftControls({ database, databaseData, isDatabaseDataLoading, }: HeaderLeftControlsProps) { const healthcheckAvailable = useDatabaseHealthcheckAvailable(databaseData?.Type); const showCopyButton = Boolean(databaseData?.Name); const isServerless = databaseData?.Type === 'Serverless'; const showHealthcheck = healthcheckAvailable && !isDatabaseDataLoading; return ( {showCopyButton && databaseData?.Name ? ( ) : null} {isServerless ? : null} {showHealthcheck ? : null} ); }