11import React , { useState , useEffect } from 'react' ;
22import { useTranslation } from 'react-i18next' ;
3- import { BaseCard } from '@app/components/common/BaseCard/BaseCard' ;
43import { BaseButton } from '@app/components/common/BaseButton/BaseButton' ;
54import { BaseSelect } from '@app/components/common/selects/BaseSelect/BaseSelect' ;
65import { BaseSpace } from '@app/components/common/BaseSpace/BaseSpace' ;
@@ -9,7 +8,7 @@ import { BaseCol } from '@app/components/common/BaseCol/BaseCol';
98import { BasePagination } from '@app/components/common/BasePagination/BasePagination' ;
109import { BaseNotification } from '@app/components/common/BaseNotification/BaseNotification' ;
1110import { usePaymentNotifications } from '@app/hooks/usePaymentNotifications' ;
12- import { PaymentNotification , PaymentNotificationParams } from '@app/api/paymentNotifications.api' ;
11+ import { PaymentNotificationParams } from '@app/api/paymentNotifications.api' ;
1312import { notificationController } from '@app/controllers/notificationController' ;
1413import * as S from './PaymentNotifications.styles' ;
1514
@@ -25,141 +24,6 @@ export const PaymentNotifications: React.FC<PaymentNotificationsProps> = ({ clas
2524 const { notifications, pagination, isLoading, fetchNotifications, markAsRead, markAllAsRead } =
2625 usePaymentNotifications ( ) ;
2726
28- const testNotifications : PaymentNotification [ ] = [
29- {
30- id : 1231203013202 ,
31- pubkey : 'npub1examplepubkey1234567890' ,
32- tx_id : 'tx1234567890abcdef' ,
33- amount : 1000 , // in satoshis
34- subscription_tier : '5GB' ,
35- is_new_subscriber : true ,
36- expiration_date : '2024-12-31T23:59:59Z' ,
37- created_at : '2024-01-01T12:00:00Z' ,
38- is_read : false ,
39- } ,
40- {
41- id : 1231203013203 ,
42- pubkey : 'npub1anotheruser0987654321' ,
43- tx_id : 'txabcdef1234567890' ,
44- amount : 5000 ,
45- subscription_tier : '10GB' ,
46- is_new_subscriber : false ,
47- expiration_date : '2024-11-30T23:59:59Z' ,
48- created_at : '2024-02-10T09:30:00Z' ,
49- is_read : true ,
50- } ,
51- {
52- id : 1231203013204 ,
53- pubkey : 'npub1thirduser1122334455' ,
54- tx_id : 'txfedcba0987654321' ,
55- amount : 2500 ,
56- subscription_tier : '5GB' ,
57- is_new_subscriber : true ,
58- expiration_date : '2024-10-15T23:59:59Z' ,
59- created_at : '2024-03-05T15:45:00Z' ,
60- is_read : false ,
61- } ,
62- {
63- id : 1231203013205 ,
64- pubkey : 'npub1fourthuser5566778899' ,
65- tx_id : 'tx1122334455667788' ,
66- amount : 10000 ,
67- subscription_tier : '20GB' ,
68- is_new_subscriber : false ,
69- expiration_date : '2024-09-01T23:59:59Z' ,
70- created_at : '2024-04-12T18:20:00Z' ,
71- is_read : true ,
72- } ,
73- {
74- id : 1231203013206 ,
75- pubkey : 'npub1fifthuser9988776655' ,
76- tx_id : 'tx9988776655443322' ,
77- amount : 750 ,
78- subscription_tier : '2GB' ,
79- is_new_subscriber : true ,
80- expiration_date : '2024-08-20T23:59:59Z' ,
81- created_at : '2024-05-01T08:10:00Z' ,
82- is_read : false ,
83- } ,
84- {
85- id : 1231203013207 ,
86- pubkey : 'npub1sixthuser2233445566' ,
87- tx_id : 'tx2233445566778899' ,
88- amount : 3000 ,
89- subscription_tier : '10GB' ,
90- is_new_subscriber : false ,
91- expiration_date : '2024-07-15T23:59:59Z' ,
92- created_at : '2024-06-18T13:55:00Z' ,
93- is_read : true ,
94- } ,
95- {
96- id : 1231203013208 ,
97- pubkey : 'npub1seventhuser3344556677' ,
98- tx_id : 'tx3344556677889900' ,
99- amount : 1200 ,
100- subscription_tier : '5GB' ,
101- is_new_subscriber : true ,
102- expiration_date : '2024-06-10T23:59:59Z' ,
103- created_at : '2024-07-02T11:25:00Z' ,
104- is_read : false ,
105- } ,
106- {
107- id : 1231203013209 ,
108- pubkey : 'npub1eighthuser4455667788' ,
109- tx_id : 'tx4455667788990011' ,
110- amount : 8000 ,
111- subscription_tier : '20GB' ,
112- is_new_subscriber : false ,
113- expiration_date : '2024-05-05T23:59:59Z' ,
114- created_at : '2024-08-14T16:40:00Z' ,
115- is_read : true ,
116- } ,
117- {
118- id : 1231203013210 ,
119- pubkey : 'npub1ninthuser5566778899' ,
120- tx_id : 'tx5566778899001122' ,
121- amount : 2000 ,
122- subscription_tier : '5GB' ,
123- is_new_subscriber : true ,
124- expiration_date : '2024-04-25T23:59:59Z' ,
125- created_at : '2024-09-09T10:05:00Z' ,
126- is_read : false ,
127- } ,
128- {
129- id : 1231203013211 ,
130- pubkey : 'npub1tenthuser6677889900' ,
131- tx_id : 'tx6677889900112233' ,
132- amount : 15000 ,
133- subscription_tier : '50GB' ,
134- is_new_subscriber : false ,
135- expiration_date : '2024-03-15T23:59:59Z' ,
136- created_at : '2024-10-21T19:15:00Z' ,
137- is_read : true ,
138- } ,
139- {
140- id : 1231203013212 ,
141- pubkey : 'npub1eleventhuser7788990011' ,
142- tx_id : 'tx7788990011223344' ,
143- amount : 600 ,
144- subscription_tier : '2GB' ,
145- is_new_subscriber : true ,
146- expiration_date : '2024-02-28T23:59:59Z' ,
147- created_at : '2024-11-30T07:50:00Z' ,
148- is_read : false ,
149- } ,
150- {
151- id : 123120301321222 ,
152- pubkey : 'npub1eleventhuser7788990011' ,
153- tx_id : 'tx7788990011223344' ,
154- amount : 600 ,
155- subscription_tier : '2GB' ,
156- is_new_subscriber : false ,
157- expiration_date : '2024-02-28T23:59:59Z' ,
158- created_at : '2024-11-30T07:50:00Z' ,
159- is_read : true ,
160- } ,
161- ] ;
162-
16327 // Fetch unread notifications on component mount
16428 useEffect ( ( ) => {
16529 fetchNotifications ( {
@@ -295,10 +159,10 @@ export const PaymentNotifications: React.FC<PaymentNotificationsProps> = ({ clas
295159 < div style = { { fontSize : '28px' , marginBottom : '16px' } } > ⏳</ div >
296160 < S . Text style = { { fontSize : '16px' } } > { t ( 'common.loading' , 'Loading...' ) } </ S . Text >
297161 </ div >
298- ) : testNotifications . length > 0 ? (
162+ ) : notifications . length > 0 ? (
299163 < >
300164 < BaseSpace direction = "vertical" size = { 10 } split = { < div style = { { height : '1rem' } } > </ div > } >
301- { testNotifications . map ( ( notification ) => (
165+ { notifications . map ( ( notification ) => (
302166 < S . NotificationItem
303167 key = { notification . id }
304168 $isRead = { notification . is_read }
0 commit comments