setShowBoundOnly(Boolean(e.target.checked))}
>
{t('仅显示已绑定')}
{t('已绑定')} {boundCount} / {allBindingItems.length}
{visibleBindingItems.length === 0 ? (
{t('暂无已绑定项')}
) : (
{visibleBindingItems.map((item, index) => {
const isBound = Boolean(item.value);
const loadingKey =
item.type === 'builtin'
? `builtin-${item.key}`
: `custom-${item.providerId}`;
const statusText = isBound
? item.value
: item.enabled
? t('未绑定')
: t('未启用');
const shouldSpanTwoColsOnDesktop =
visibleBindingItems.length % 2 === 1 &&
index === visibleBindingItems.length - 1;
return (
{item.icon}
{item.name}
{item.type === 'builtin'
? t('内置')
: t('自定义')}
{statusText}
}
size='small'
disabled={!isBound}
loading={Boolean(bindingActionLoading[loadingKey])}
onClick={() => {
if (item.type === 'builtin') {
handleUnbindBuiltInAccount(item);
return;
}
handleUnbindCustomOAuthAccount({
id: item.providerId,
name: item.name,
});
}}
>
{t('解绑')}
);
})}
)}