- 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
28 lines
625 B
TypeScript
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"
|
|
/>
|
|
);
|