|
1 | | -import { BitcoinIcon, CreditCardIcon, StarIcon } from 'lucide-react' |
2 | | -import { ComponentType, SVGProps } from 'react' |
3 | 1 | import { Control } from 'react-hook-form' |
4 | 2 |
|
5 | | -import { SbpIcon } from '../icons/sbp-icon' |
6 | | -import { YoomoneyIcon } from '../icons/yoomoney-icon' |
7 | | - |
8 | 3 | import type { PaymentFormValues } from './premium' |
9 | | -import { InitPaymentRequestMethod } from '@/src/api/generated' |
10 | 4 | import { FormControl, FormField, FormItem } from '@/src/components/ui/form' |
11 | 5 | import { Label } from '@/src/components/ui/label' |
12 | 6 | import { RadioGroup, RadioGroupItem } from '@/src/components/ui/radio-group' |
| 7 | +import { paymentMethods } from '@/src/constants' |
13 | 8 | import { cn } from '@/src/lib/utils' |
14 | 9 |
|
15 | | -interface PaymentMethod { |
16 | | - id: InitPaymentRequestMethod |
17 | | - name: string |
18 | | - description: string |
19 | | - icon: ComponentType<SVGProps<SVGSVGElement>> |
20 | | - textColor: string |
21 | | - bgColor: string |
22 | | - isAllowed?: boolean |
23 | | -} |
24 | | - |
25 | | -const paymentMethods: PaymentMethod[] = [ |
26 | | - { |
27 | | - id: InitPaymentRequestMethod.BANK_CARD, |
28 | | - name: 'Банковская карта', |
29 | | - description: 'Оплата кредитной или дебетовой картой', |
30 | | - icon: CreditCardIcon, |
31 | | - textColor: 'text-blue-600', |
32 | | - bgColor: 'bg-blue-100', |
33 | | - isAllowed: true |
34 | | - }, |
35 | | - { |
36 | | - id: InitPaymentRequestMethod.SBP, |
37 | | - name: 'СБП', |
38 | | - description: 'Оплата через Систему быстрых платежей', |
39 | | - icon: SbpIcon, |
40 | | - textColor: 'text-blue-600', |
41 | | - bgColor: 'bg-blue-100', |
42 | | - isAllowed: true |
43 | | - }, |
44 | | - // { |
45 | | - // id: InitPaymentRequestMethod.YOOMONEY, |
46 | | - // name: 'ЮMoney', |
47 | | - // description: 'Оплата через кошелек ЮMoney', |
48 | | - // icon: YoomoneyIcon, |
49 | | - // textColor: 'text-blue-600', |
50 | | - // bgColor: 'bg-blue-100', |
51 | | - // isAllowed: false |
52 | | - // }, |
53 | | - // { |
54 | | - // id: InitPaymentRequestMethod.STARS, |
55 | | - // name: 'Telegram Stars', |
56 | | - // description: 'Оплата подписки через звёзды Telegram', |
57 | | - // icon: StarIcon, |
58 | | - // textColor: 'text-blue-600', |
59 | | - // bgColor: 'bg-blue-100', |
60 | | - // isAllowed: true |
61 | | - // } |
62 | | - { |
63 | | - id: 'CRYPTO', |
64 | | - name: 'Криптовалюта', |
65 | | - description: 'Оплата с помощью BTC, USDT, TON', |
66 | | - icon: BitcoinIcon, |
67 | | - textColor: 'text-blue-600', |
68 | | - bgColor: 'bg-blue-100', |
69 | | - isAllowed: false |
70 | | - } |
71 | | -] |
72 | | - |
73 | 10 | interface PaymentMethodsProps { |
74 | 11 | control: Control<PaymentFormValues> |
75 | 12 | } |
|
0 commit comments