import { useTranslation } from 'react-i18next'; import { Button } from '@/components/ui/Button'; import { EmptyState } from '@/components/ui/EmptyState'; import type { OAuthConfigLoadError } from '@/features/authFiles/constants'; import styles from './OAuthConfigPanels.module.scss'; export type OAuthExcludedCardProps = { disableControls: boolean; excludedError: OAuthConfigLoadError; excluded: Record; onRetry: () => void | Promise; onAdd: () => void; onEdit: (provider: string) => void; onDelete: (provider: string) => void; }; export function OAuthExcludedCard(props: OAuthExcludedCardProps) { const { t } = useTranslation(); const { disableControls, excludedError, excluded, onRetry, onAdd, onEdit, onDelete } = props; return (

{t('oauth_excluded.title')}

{excludedError === 'unsupported' ? ( ) : excludedError === 'load' ? ( void onRetry()}> {t('common.refresh')} } /> ) : excludedError === 'loading' ? ( ) : Object.keys(excluded).length === 0 ? ( ) : (
{Object.entries(excluded).map(([provider, models]) => (
{provider}
{models?.length ? t('oauth_excluded.model_count', { count: models.length }) : t('oauth_excluded.no_models')}
))}
)}
); }