You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

page.tsx 3.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106
  1. 'use client';
  2. import React, { useState } from 'react';
  3. import Link from 'next/link';
  4. import { useRouter } from 'next/navigation';
  5. import PageTitle from '@/components/ui/PageTitle';
  6. import {
  7. Typography,
  8. Input,
  9. Button,
  10. Radio,
  11. Row,
  12. Col,
  13. Card,
  14. Form,
  15. Space,
  16. } from 'antd';
  17. const { Text } = Typography;
  18. const Wallet: React.FC = () => {
  19. const [amount, setAmount] = useState('');
  20. const [autoRenew, setAutoRenew] = useState(false);
  21. const router = useRouter();
  22. return (
  23. <main className="min-h-screen bg-white">
  24. {/* Page Header */}
  25. <PageTitle>Wallet</PageTitle>
  26. <Row justify="center" className="mt-6">
  27. <Col xs={24} sm={20} md={16} lg={12}>
  28. <Form layout="vertical" className='!px-5'>
  29. {/* 1. Balance + History Link */}
  30. <Form.Item>
  31. <Space className="w-full justify-between" align="center">
  32. <Text strong>Current Balance</Text>
  33. <Link
  34. href="/user/payment/transaction-history"
  35. className="text-blue-500 underline text-sm"
  36. >
  37. Transaction History
  38. </Link>
  39. </Space>
  40. </Form.Item>
  41. {/* 2. Top-Up Section */}
  42. <Form.Item label="Top-Up Amount (RM)">
  43. <Input
  44. placeholder="Enter amount"
  45. type="number"
  46. value={amount}
  47. onChange={(e) => setAmount(e.target.value)}
  48. size="large"
  49. className="border-blue-500 bg-blue-50"
  50. />
  51. </Form.Item>
  52. <Form.Item className="!text-right">
  53. <Button
  54. type="primary"
  55. className="!text-xs !font-bold !px-6 !py-2"
  56. onClick={() => {
  57. router.push('/user/payment')
  58. }}
  59. >
  60. Top Up Wallet
  61. </Button>
  62. </Form.Item>
  63. {/* 3. Auto-Renew */}
  64. <Form.Item>
  65. <Row align="top" gutter={16}>
  66. <Col>
  67. <Radio
  68. checked={autoRenew}
  69. onChange={(e) => setAutoRenew(e.target.checked)}
  70. />
  71. </Col>
  72. <Col flex="auto">
  73. <Text strong>Auto-Renew Subscription</Text>
  74. <p className="text-xs text-gray-500">
  75. Enable monthly or yearly auto payment using wallet.
  76. </p>
  77. </Col>
  78. </Row>
  79. </Form.Item>
  80. </Form>
  81. {/* 4. Current Plan Display */}
  82. <Card
  83. bordered
  84. className="!border-blue-700 !rounded-none"
  85. bodyStyle={{ padding: '12px' }}
  86. >
  87. <Text>
  88. <Text strong>Current Plan:</Text> Premium (RM25/Month)
  89. </Text>
  90. </Card>
  91. </Col>
  92. </Row>
  93. </main>
  94. );
  95. };
  96. export default Wallet;