2
2
import BottomFixedButton , {
3
3
Button ,
4
4
} from "@/app/(_components)/bottom-fixed-button" ;
5
- import Link from "next/link " ;
5
+ import BottomSheet from "@/app/(_components)/bottom-sheet " ;
6
6
import { PATH } from "@/lib/_shared/paths" ;
7
+ import { AccountType } from "@/types/api/pay" ;
8
+ import getBankId from "@/utils/getBankName" ;
7
9
import Image from "next/image" ;
8
- import BottomSheet from "@/app/(_components)/bottom-sheet " ;
10
+ import Link from "next/link " ;
9
11
import {
10
- useState ,
11
12
ChangeEventHandler ,
12
13
KeyboardEventHandler ,
13
14
useEffect ,
15
+ useState ,
14
16
} from "react" ;
15
17
16
- const accounts = [
17
- { id : "hana" , name : "하나" , accountNum : 1010102030210 } ,
18
- { id : "woori" , name : "우리" , accountNum : 1000023366635 } ,
18
+ const accounts : AccountType [ ] = [
19
+ {
20
+ accountId : 123 ,
21
+ bankName : "하나" ,
22
+ accountNum : 1010102030210 ,
23
+ accountStatus : "ACTIVE" ,
24
+ createdAt : new Date ( ) ,
25
+ updatedAt : new Date ( ) ,
26
+ accountHolder : "이채민" ,
27
+ } ,
28
+ {
29
+ accountId : 2322 ,
30
+ bankName : "우리" ,
31
+ accountNum : 1000023366635 ,
32
+ accountStatus : "ACTIVE" ,
33
+ createdAt : new Date ( ) ,
34
+ updatedAt : new Date ( ) ,
35
+ accountHolder : "이채민" ,
36
+ } ,
19
37
] ;
20
38
21
39
const pay = 12230 ;
@@ -41,7 +59,12 @@ export default function AccountListPage() {
41
59
< div className = "flex flex-col gap-10 pt-5" >
42
60
< h1 className = "text-t2" > 연결 계좌</ h1 >
43
61
< ul className = "flex flex-col " >
44
- { accounts . map ( ( { id, name, accountNum } ) => (
62
+ { accounts . length === 0 && (
63
+ < div className = "text-center text-shadow-500" >
64
+ 등록된 계좌가 없습니다
65
+ </ div >
66
+ ) }
67
+ { accounts . map ( ( { bankName, accountNum } ) => (
45
68
< div
46
69
key = { accountNum }
47
70
className = "flex justify-between hover:bg-shadow-800 p-5 rounded-xl"
@@ -51,12 +74,12 @@ export default function AccountListPage() {
51
74
< Image
52
75
width = { 28 }
53
76
height = { 28 }
54
- src = { `/icons/bank/${ id } .svg` }
55
- alt = { name }
77
+ src = { `/icons/bank/${ getBankId ( bankName ) } .svg` }
78
+ alt = { bankName }
56
79
/>
57
80
</ div >
58
81
< div className = "text-bd1" >
59
- { name }
82
+ { bankName }
60
83
{ accountNum . toString ( ) . slice ( - 4 ) }
61
84
</ div >
62
85
</ div >
0 commit comments