Closes #5899 <img width="1280" alt="Index - banner" src="https://github.com/twentyhq/twenty/assets/71827178/313cf20d-eb34-496a-8c7c-7589fbd55954"> --------- Co-authored-by: Charles Bochet <charles@twenty.com>
27 lines
749 B
TypeScript
27 lines
749 B
TypeScript
import { currentUserState } from '@/auth/states/currentUserState';
|
|
import { InformationBannerAccountToReconnect } from '@/information-banner/InformationBannerReconnectAccount';
|
|
import { useRecoilValue } from 'recoil';
|
|
|
|
export enum InformationBannerKeys {
|
|
ACCOUNTS_TO_RECONNECT = 'ACCOUNTS_TO_RECONNECT',
|
|
}
|
|
|
|
export const InformationBanner = () => {
|
|
const currentUser = useRecoilValue(currentUserState);
|
|
|
|
const userVars = currentUser?.userVars;
|
|
|
|
const firstAccountIdToReconnect =
|
|
userVars?.[InformationBannerKeys.ACCOUNTS_TO_RECONNECT]?.[0];
|
|
|
|
return (
|
|
<>
|
|
{firstAccountIdToReconnect && (
|
|
<InformationBannerAccountToReconnect
|
|
accountIdToReconnect={firstAccountIdToReconnect}
|
|
/>
|
|
)}
|
|
</>
|
|
);
|
|
};
|