feat/paymenet-methods
This commit is contained in:
parent
e723dde47f
commit
92d2d3f058
@ -10,38 +10,26 @@ interface IPaymentMethodProps {
|
||||
}
|
||||
|
||||
function PaymentMethod({ method, onSelect }: IPaymentMethodProps) {
|
||||
|
||||
const { name, type, isActive, icon } = method;
|
||||
const handleClick = () => {
|
||||
onSelect?.(method);
|
||||
};
|
||||
|
||||
return (
|
||||
<div
|
||||
className={bem(block, null, method.isActive ? 'active' : null)}
|
||||
className={bem(block, null, isActive ? 'active' : null)}
|
||||
onClick={handleClick}
|
||||
>
|
||||
{method.icon && (
|
||||
{icon && (
|
||||
<div className={bem(block, 'icon')}>
|
||||
<img src={method.icon} alt={method.name} />
|
||||
<img src={icon} alt={name} />
|
||||
</div>
|
||||
)}
|
||||
<div className={bem(block, 'content')}>
|
||||
<h3 className={bem(block, 'name')}>{method.name}</h3>
|
||||
<p className={bem(block, 'type')}>{method.type}</p>
|
||||
{(method.minAmount || method.maxAmount) && (
|
||||
<div className={bem(block, 'limits')}>
|
||||
{method.minAmount && (
|
||||
<span className={bem(block, 'limit')}>
|
||||
Min: ${method.minAmount}
|
||||
</span>
|
||||
)}
|
||||
{method.maxAmount && (
|
||||
<span className={bem(block, 'limit')}>
|
||||
Max: ${method.maxAmount}
|
||||
</span>
|
||||
)}
|
||||
</div>
|
||||
)}
|
||||
</div>
|
||||
<h3 className={bem(block, 'name')}>{name}</h3>
|
||||
<p className={bem(block, 'type')}>{type}</p>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user