…atabase/Connection page Closes #4558 <img width="542" alt="image" src="https://github.com/twentyhq/twenty/assets/3098428/16d7d8ce-57db-4e48-ba72-a2318a2d34a4"> --------- Co-authored-by: Lucas Bordeau <bordeau.lucas@gmail.com>
45 lines
1.2 KiB
TypeScript
45 lines
1.2 KiB
TypeScript
import styled from '@emotion/styled';
|
|
|
|
import { SettingsSummaryCard } from '@/settings/components/SettingsSummaryCard';
|
|
import { SettingsIntegrationDatabaseConnectedTablesStatus } from '@/settings/integrations/components/SettingsIntegrationDatabaseConnectedTablesStatus';
|
|
|
|
type SettingsIntegrationDatabaseConnectionSummaryCardProps = {
|
|
databaseLogoUrl: string;
|
|
connectionName: string;
|
|
connectedTablesNb: number;
|
|
};
|
|
|
|
const StyledDatabaseLogoContainer = styled.div`
|
|
align-items: center;
|
|
display: flex;
|
|
height: ${({ theme }) => theme.spacing(4)};
|
|
justify-content: center;
|
|
width: ${({ theme }) => theme.spacing(4)};
|
|
`;
|
|
|
|
const StyledDatabaseLogo = styled.img`
|
|
height: 100%;
|
|
`;
|
|
|
|
export const SettingsIntegrationDatabaseConnectionSummaryCard = ({
|
|
databaseLogoUrl,
|
|
connectionName,
|
|
connectedTablesNb,
|
|
}: SettingsIntegrationDatabaseConnectionSummaryCardProps) => (
|
|
<SettingsSummaryCard
|
|
title={
|
|
<>
|
|
<StyledDatabaseLogoContainer>
|
|
<StyledDatabaseLogo alt="" src={databaseLogoUrl} />
|
|
</StyledDatabaseLogoContainer>
|
|
{connectionName}
|
|
</>
|
|
}
|
|
rightComponent={
|
|
<SettingsIntegrationDatabaseConnectedTablesStatus
|
|
connectedTablesCount={connectedTablesNb}
|
|
/>
|
|
}
|
|
/>
|
|
);
|