You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
spa_instat_tv/src/features/UserAccount/components/BankCard/index.tsx

39 lines
880 B

import type { Card } from 'requests/getCardsList'
import { T9n } from 'features/T9n'
import { Arrows } from 'features/ArrowLoader/styled'
import { InlineButton } from '../../styled'
import { CardNumberWrapper, CustomRadio } from './styled'
type Props = {
card: Card,
checked?: boolean,
loader?: boolean,
onChange: (cardId: string) => void,
onDelete: (cardId: string) => void,
}
export const BankCard = ({
card,
checked,
loader,
onChange,
onDelete,
}: Props) => (
<CardNumberWrapper>
<CustomRadio
label={`${card.brand} •••• ${card.last4}`}
checked={checked}
onChange={() => onChange(card.id)}
/>
<InlineButton
disabled={loader}
onClick={() => onDelete(card.id)}
>
{loader
? <Arrows backgroundSize='20px 20px' />
: <T9n t='remove' />}
</InlineButton>
</CardNumberWrapper>
)