Files
calculator/src/widgets/withdrawal-rate-section/ui/WithdrawalRateSection.tsx
T
Alex Ant bcd9f7c06d restyle
2026-03-12 14:27:54 +05:00

35 lines
1.0 KiB
TypeScript

import { BaseCard, DescriptionText, DebouncedInputSlider, TEXTS } from '../../../shared';
import { FC } from 'react';
interface WithdrawalRateSectionProps {
withdrawalRate: number;
onWithdrawalRateChange: (value: number) => void;
}
export const WithdrawalRateSection: FC<WithdrawalRateSectionProps> = ({
withdrawalRate,
onWithdrawalRateChange,
}) => {
return (
<BaseCard title={TEXTS.withdrawalRate.title}>
<div>
<div className="slider-container">
<DebouncedInputSlider
value={withdrawalRate}
onChange={onWithdrawalRateChange}
min={0}
max={100}
step={5}
tooltipFormatter={(value: number | undefined) => `${value}%`}
sliderStyle={{ marginBottom: 0 }}
unitSuffix="%"
// marks={{ 0: '0%', 50: '50%', 100: '100%' }} // если понадобится
/>
</div>
<DescriptionText>
{TEXTS.withdrawalRate.description}
</DescriptionText>
</div>
</BaseCard>
);
};