import './AccountActions.style.scss'; import { Color } from '@signozhq/design-tokens'; import { Button, Select, Skeleton } from 'antd'; import { SelectProps } from 'antd/lib'; import { useAwsAccounts } from 'hooks/integrations/aws/useAwsAccounts'; import useUrlQuery from 'hooks/useUrlQuery'; import { Check, ChevronDown } from 'lucide-react'; import { useEffect, useMemo, useState } from 'react'; import { useNavigate } from 'react-router-dom-v5-compat'; import { CloudAccount } from '../../ServicesSection/types'; import AccountSettingsModal from './AccountSettingsModal'; import CloudAccountSetupModal from './CloudAccountSetupModal'; interface AccountOptionItemProps { label: React.ReactNode; isSelected: boolean; } function AccountOptionItem({ label, isSelected, }: AccountOptionItemProps): JSX.Element { return (
{label} {isSelected && (
)}
); } function renderOption( // eslint-disable-next-line @typescript-eslint/no-explicit-any option: any, activeAccountId: string | undefined, ): JSX.Element { return ( ); } const getAccountById = ( accounts: CloudAccount[], accountId: string, ): CloudAccount | null => accounts.find((account) => account.cloud_account_id === accountId) || null; function AccountActionsRenderer({ accounts, isLoading, activeAccount, selectOptions, onAccountChange, onIntegrationModalOpen, onAccountSettingsModalOpen, }: { accounts: CloudAccount[] | undefined; isLoading: boolean; activeAccount: CloudAccount | null; selectOptions: SelectProps['options']; onAccountChange: (value: string) => void; onIntegrationModalOpen: () => void; onAccountSettingsModalOpen: () => void; }): JSX.Element { if (isLoading) { return (
); } if (accounts?.length) { return (