feat: add Database Connection Summary Card to Settings/Integrations/D… (#4791)
…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>
This commit is contained in:
@ -0,0 +1,18 @@
|
||||
import { Status } from '@/ui/display/status/components/Status';
|
||||
|
||||
type SettingsIntegrationDatabaseConnectedTablesStatusProps = {
|
||||
connectedTablesCount: number;
|
||||
};
|
||||
|
||||
export const SettingsIntegrationDatabaseConnectedTablesStatus = ({
|
||||
connectedTablesCount,
|
||||
}: SettingsIntegrationDatabaseConnectedTablesStatusProps) => (
|
||||
<Status
|
||||
color="green"
|
||||
text={
|
||||
connectedTablesCount === 1
|
||||
? `1 tracked table`
|
||||
: `${connectedTablesCount} tracked tables`
|
||||
}
|
||||
/>
|
||||
);
|
||||
@ -3,7 +3,7 @@ import styled from '@emotion/styled';
|
||||
import { IconChevronRight } from 'twenty-ui';
|
||||
|
||||
import { SettingsListCard } from '@/settings/components/SettingsListCard';
|
||||
import { Status } from '@/ui/display/status/components/Status';
|
||||
import { SettingsIntegrationDatabaseConnectedTablesStatus } from '@/settings/integrations/components/SettingsIntegrationDatabaseConnectedTablesStatus';
|
||||
import { LightIconButton } from '@/ui/input/button/components/LightIconButton';
|
||||
|
||||
type SettingsIntegrationDatabaseConnectionsListCardProps = {
|
||||
@ -52,13 +52,8 @@ export const SettingsIntegrationDatabaseConnectionsListCard = ({
|
||||
)}
|
||||
RowRightComponent={({ item: connection }) => (
|
||||
<StyledRowRightContainer>
|
||||
<Status
|
||||
color="green"
|
||||
text={
|
||||
connection.tables.length === 1
|
||||
? `1 tracked table`
|
||||
: `${connection.tables.length} tracked tables`
|
||||
}
|
||||
<SettingsIntegrationDatabaseConnectedTablesStatus
|
||||
connectedTablesCount={connection.tables.length}
|
||||
/>
|
||||
<LightIconButton Icon={IconChevronRight} accent="tertiary" />
|
||||
</StyledRowRightContainer>
|
||||
|
||||
Reference in New Issue
Block a user