1
+ 'use client' ;
2
+
3
+ import DataTable from "../../components/organisms/DataTable" ;
4
+ import { useLedgerTableContext } from "../../context/ledger/LedgerDataTableProvider" ;
5
+ import Container from "../common/uiLibrary/container" ;
6
+ import PageHeading from "../common/uiLibrary/PageHeading" ;
7
+ import { useLedgerApiProvider } from "../../context/ledger/LedgerApiProvider" ;
8
+ import Panel from "../common/uiLibrary/panel" ;
9
+ import { RiPatreonFill } from "react-icons/ri" ;
10
+ import { FaPaypal } from "react-icons/fa" ;
11
+ import { PATREON_URL , PAYPAL_DONATION_URL } from "../../utils/urlContants" ;
12
+
13
+ export default function LedgerPresentation ( ) {
14
+ const content = useLedgerTableContext ( ) ;
15
+ const { hasNextPage, hasPreviousPage, goToPreviousPage, goToNextPage, currentBalance} = useLedgerApiProvider ( ) ;
16
+
17
+ return (
18
+ < Container >
19
+ < PageHeading > Funding Ledger</ PageHeading >
20
+ < div className = "flex justify-between gap-4" >
21
+ < Panel className = "rounded-lg w-50" >
22
+ < div className = "text-lg font-semibold text-gray-200" > Current Balance</ div >
23
+ < div className = "text-3xl font-bold text-green-400" >
24
+ ${ currentBalance }
25
+ </ div >
26
+ < p className = "mt-2 text-sm text-gray-400" >
27
+ This is the amount currently available in Unitystation’s project fund.
28
+ It updates manually after we receive a donation or withdraw from Patreon.
29
+ </ p >
30
+ < p className = "mt-2 text-sm text-gray-400" >
31
+ If your donation is not listed yet, it will appear soon once we update the ledger.
32
+ </ p >
33
+ </ Panel >
34
+ < Panel className = "rounded-lg" >
35
+ < div className = "text-lg font-semibold text-gray-200 mb-2" >
36
+ Where does our funding come from?
37
+ </ div >
38
+
39
+ < p className = "text-sm text-gray-400 mb-4" >
40
+ Unitystation is sustained entirely through community support; whether by backing us on Patreon or sending direct donations. Every contribution helps cover hosting, development, and infrastructure.
41
+ </ p >
42
+
43
+ < div className = "flex gap-4 items-center mt-4" >
44
+ < a
45
+ href = { PATREON_URL }
46
+ target = "_blank"
47
+ rel = "noopener noreferrer"
48
+ className = "flex items-center gap-2 px-4 py-2 text-white bg-[#ff424d] rounded hover:bg-[#e63946] transition"
49
+ >
50
+ < RiPatreonFill size = { 20 } />
51
+ Support us on Patreon
52
+ </ a >
53
+
54
+ < a
55
+ href = { PAYPAL_DONATION_URL }
56
+ className = "flex items-center gap-2 px-4 py-2 text-white bg-[#00457C] rounded hover:bg-[#003a6b] transition"
57
+ >
58
+ < FaPaypal size = { 20 } />
59
+ Donate via PayPal
60
+ </ a >
61
+ </ div >
62
+ </ Panel >
63
+ </ div >
64
+
65
+ < DataTable columns = { content . columns } data = { content . data } />
66
+
67
+ { /*TODO: make this shit a generic component and stylise it*/ }
68
+ < div className = "flex justify-between p-5" >
69
+ < div className = "flex-1" >
70
+ { hasPreviousPage && (
71
+ < button className = "hover:!text-blue-700" onClick = { goToPreviousPage } > Previous</ button >
72
+ ) }
73
+ </ div >
74
+
75
+ < div className = "flex-1 text-right" >
76
+ { hasNextPage && (
77
+ < button className = "hover:!text-blue-700" onClick = { goToNextPage } > Next</ button >
78
+ ) }
79
+ </ div >
80
+ </ div >
81
+ </ Container >
82
+ ) ;
83
+ }
0 commit comments