Files
twenty/packages/twenty-front/src/modules/settings/accounts/components/SettingsAccountsSynchronizationStatus.tsx
bosiraphael ffb1733f39 Fix invalid token after credentials change (#4717)
- If sync fails we set authFailedAt
- This information is displayed in the frontend in accounts with a `Sync
Failed` pill
- The user can reconnect his account in the dropdown menu
- A new OAuth flow is triggered
- The account is synced
2024-04-02 11:32:27 +02:00

28 lines
625 B
TypeScript

import { Status } from '@/ui/display/status/components/Status';
export type SettingsAccountsSynchronizationStatusProps = {
syncStatus: 'synced' | 'failed' | 'notSynced';
};
export const SettingsAccountsSynchronizationStatus = ({
syncStatus,
}: SettingsAccountsSynchronizationStatusProps) => (
<Status
color={
syncStatus === 'synced'
? 'green'
: syncStatus === 'failed'
? 'red'
: 'gray'
}
text={
syncStatus === 'synced'
? 'Synced'
: syncStatus === 'failed'
? 'Sync failed'
: 'Not synced'
}
weight="medium"
/>
);