|
@@ -0,0 +1,145 @@
|
|
1
|
+import React, { useState } from 'react';
|
|
2
|
+import {
|
|
3
|
+ Box,
|
|
4
|
+ TextField,
|
|
5
|
+ Button,
|
|
6
|
+ Typography,
|
|
7
|
+ MenuItem,
|
|
8
|
+ RadioGroup,
|
|
9
|
+ FormControlLabel,
|
|
10
|
+ Radio,
|
|
11
|
+} from '@mui/material';
|
|
12
|
+import Table from '@mui/material/Table';
|
|
13
|
+import TableBody from '@mui/material/TableBody';
|
|
14
|
+import TableCell from '@mui/material/TableCell';
|
|
15
|
+import TableContainer from '@mui/material/TableContainer';
|
|
16
|
+import TableHead from '@mui/material/TableHead';
|
|
17
|
+import TableRow from '@mui/material/TableRow';
|
|
18
|
+import Grid from '@mui/material/Grid2';
|
|
19
|
+
|
|
20
|
+const BillingForm = () => {
|
|
21
|
+
|
|
22
|
+ const rows = [
|
|
23
|
+ {
|
|
24
|
+ img_src: 'https://via.placeholder.com/300',
|
|
25
|
+ name: 'MELUR',
|
|
26
|
+ description: 'Atma Sari New Raya Collection 2024',
|
|
27
|
+ colour: 'black',
|
|
28
|
+ quantity: 1,
|
|
29
|
+ price: 335.50
|
|
30
|
+ }
|
|
31
|
+ ];
|
|
32
|
+
|
|
33
|
+ const [shippingMethod, setShippingMethod] = useState('COD');
|
|
34
|
+
|
|
35
|
+ const handleSubmit = (e) => {
|
|
36
|
+ e.preventDefault();
|
|
37
|
+ // Handle form submission logic
|
|
38
|
+ console.log('Form submitted');
|
|
39
|
+ };
|
|
40
|
+
|
|
41
|
+ const FieldContainer = ({ label, children }) => (
|
|
42
|
+ <Box sx={{ display: 'flex', alignItems: 'center', gap: 2 }}>
|
|
43
|
+ <Typography variant="body1" sx={{ fontWeight: 500, minWidth: 120 }}>
|
|
44
|
+ {label}
|
|
45
|
+ </Typography>
|
|
46
|
+ {children}
|
|
47
|
+ </Box>
|
|
48
|
+ );
|
|
49
|
+
|
|
50
|
+ return (
|
|
51
|
+ <Box
|
|
52
|
+
|
|
53
|
+ onSubmit={handleSubmit}
|
|
54
|
+ sx={{
|
|
55
|
+ width: '100%',
|
|
56
|
+ }}
|
|
57
|
+ >
|
|
58
|
+
|
|
59
|
+ {/* Product List */}
|
|
60
|
+ <TableContainer>
|
|
61
|
+ <Table sx={{ minWidth: 650, mb: 5, backgroundColor:"#F7FBFF" }}>
|
|
62
|
+ <TableHead>
|
|
63
|
+ <TableRow>
|
|
64
|
+ <TableCell width={150}>
|
|
65
|
+ <Typography variant='body1'>Item</Typography>
|
|
66
|
+ </TableCell>
|
|
67
|
+ <TableCell width={150}>
|
|
68
|
+ {/* This is just for table offset */}
|
|
69
|
+ <Typography variant='body1'></Typography>
|
|
70
|
+ </TableCell>
|
|
71
|
+ <TableCell align='center'>
|
|
72
|
+ <Typography variant='body1'>Colour</Typography>
|
|
73
|
+ </TableCell>
|
|
74
|
+ <TableCell align='center'>
|
|
75
|
+
|
|
76
|
+ <Typography variant='body1'>Quantity</Typography>
|
|
77
|
+ </TableCell>
|
|
78
|
+ <TableCell align='center'>
|
|
79
|
+ <Typography variant='body1'>Unit Price</Typography>
|
|
80
|
+ </TableCell>
|
|
81
|
+ <TableCell align='center'>
|
|
82
|
+ <Typography variant='body1'>Shipping</Typography>
|
|
83
|
+ </TableCell>
|
|
84
|
+ <TableCell align='center'>
|
|
85
|
+ <Typography variant='body1'>Tax</Typography>
|
|
86
|
+ </TableCell>
|
|
87
|
+ <TableCell align='center'>
|
|
88
|
+ <Typography variant='body1'>Duties</Typography>
|
|
89
|
+ </TableCell>
|
|
90
|
+ </TableRow>
|
|
91
|
+ </TableHead>
|
|
92
|
+ <TableBody>
|
|
93
|
+ {rows.map((row) => (
|
|
94
|
+ <TableRow
|
|
95
|
+ key={row.id}
|
|
96
|
+ sx={{
|
|
97
|
+ '& td, & th': { border: 0 },
|
|
98
|
+ '&:last-child td, &:last-child th': { border: 0 }
|
|
99
|
+ }}
|
|
100
|
+ >
|
|
101
|
+ <TableCell component="th" scope="row">
|
|
102
|
+ <img
|
|
103
|
+ src={row.img_src}
|
|
104
|
+ alt={row.img_src}
|
|
105
|
+ style={{
|
|
106
|
+ width: 100,
|
|
107
|
+ height: 100,
|
|
108
|
+ aspectRatio: '4 / 4',
|
|
109
|
+ objectFit: 'cover',
|
|
110
|
+ }}
|
|
111
|
+ />
|
|
112
|
+ </TableCell>
|
|
113
|
+ <TableCell>
|
|
114
|
+ <Typography variant='body2' sx={{ fontWeight: "bold", mb: 1 }}>{row.name}</Typography>
|
|
115
|
+ <Typography variant='body2'>{row.description}</Typography>
|
|
116
|
+ </TableCell>
|
|
117
|
+ <TableCell align='center'>
|
|
118
|
+ <Typography variant='body1' sx={{ fontWeight: "bold" }} >{row.colour}</Typography>
|
|
119
|
+ </TableCell>
|
|
120
|
+ <TableCell align='center'>
|
|
121
|
+ <Typography variant='body1' sx={{ fontWeight: "bold" }}>{row.quantity}</Typography>
|
|
122
|
+ </TableCell>
|
|
123
|
+ <TableCell align='center'>
|
|
124
|
+ <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
|
|
125
|
+ </TableCell>
|
|
126
|
+ <TableCell align='center'>
|
|
127
|
+ <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
|
|
128
|
+ </TableCell>
|
|
129
|
+ <TableCell align='center'>
|
|
130
|
+ <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
|
|
131
|
+ </TableCell>
|
|
132
|
+ <TableCell align='center'>
|
|
133
|
+ <Typography variant='body1' sx={{ fontWeight: "bold" }}>{`RM ${parseFloat(row.price).toFixed(2)}`}</Typography>
|
|
134
|
+ </TableCell>
|
|
135
|
+ </TableRow>
|
|
136
|
+ ))}
|
|
137
|
+ </TableBody>
|
|
138
|
+ </Table>
|
|
139
|
+ </TableContainer>
|
|
140
|
+
|
|
141
|
+ </Box>
|
|
142
|
+ );
|
|
143
|
+};
|
|
144
|
+
|
|
145
|
+export default BillingForm;
|