1+ import searchIcon from "../../../assets/search2.svg" ;
2+ import closeIcon from "../../../assets/cancel.svg" ;
3+ import { useState } from "react" ;
14
25export function ChatListHeader ( {
3- activeTab,
4- setActiveTab,
56 sortLabel,
67 onClickSort,
78} : {
@@ -10,48 +11,60 @@ export function ChatListHeader({
1011 sortLabel : string ;
1112 onClickSort : ( ) => void ;
1213 sortOpen : boolean ;
14+
1315} ) {
16+ const [ query , setQuery ] = useState ( "" ) ;
17+
1418 return (
15- < div className = "flex items-center justify-between mb-4" >
16- { /* 탭 */ }
17- < div className = "flex gap-4" >
18- < button className = { `
19- text-Medium
20- ${ activeTab === "sent" ? "!text-[#6666E5]" : "text-gray3" }
21- ` }
22- onClick = { ( ) => setActiveTab ( "sent" ) }
23- >
24- 보낸 제안
25- </ button >
26- < button className = { `
27- text-Medium
28- ${ activeTab === "received" ? "!text-[#6666E5]" : "text-gray3" }
29- ` }
30- onClick = { ( ) => setActiveTab ( "received" ) }
19+
20+ < div className = "flex flex-col gap-4 border-b border-text-gray5" >
21+
22+ { /* 검색 입력창 */ }
23+ < div className = "flex items-center w-full relative bg-bg-w border border-core-2 rounded-[8px] px-3 py-2" >
24+ < img src = { searchIcon } alt = "search" className = "w-4 h-4 opacity-40" />
25+
26+ < input
27+ className = "flex-1 bg-transparent mx-2 outline-none text-body1 text-center placeholder:text-text-gray3"
28+ placeholder = "검색어 입력"
29+ value = { query }
30+ onChange = { ( e ) => setQuery ( e . target . value ) }
31+ />
32+
33+ < button
34+ onClick = { ( ) => setQuery ( "" ) }
35+ className = "flex-shrink-0"
3136 >
32- 받은 제안
37+ < img src = { closeIcon } alt = "close" />
3338 </ button >
39+
3440 </ div >
3541
36- { /* 정렬 버튼 - 텍스트는 sortLabel */ }
37- < button
38- onClick = { onClickSort }
39- className = "flex items-center gap-1 w-fit h-7 px-3 rounded-full border border-text-[#E6E6F3] text-[14px] font-Pretendard text-text-gray2 bg-white"
40- >
41- { sortLabel }
42- < svg
43- xmlns = "http://www.w3.org/2000/svg"
44- viewBox = "0 0 20 20"
45- fill = "currentColor"
46- className = "w-4 h-4 text-text-gray3"
42+ < div className = "flex items-center pt-2 pb-4 justify-between" >
43+
44+ < div className = "px-1 text-[16px] leading-[20px] font-Semibold text-black" >
45+ 채팅 목록
46+ </ div >
47+
48+ { /* 정렬 버튼 - 텍스트는 sortLabel */ }
49+ < button
50+ onClick = { onClickSort }
51+ className = "flex items-center gap-1 w-fit h-7 px-3 rounded-full border border-[#E6E6F3] text-[#5B5D6B] text-[14px] font-Pretendard text-text-gray2 bg-white"
4752 >
48- < path
49- fillRule = "evenodd"
50- d = "M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.25a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z"
51- clipRule = "evenodd"
52- />
53- </ svg >
54- </ button >
53+ { sortLabel }
54+ < svg
55+ xmlns = "http://www.w3.org/2000/svg"
56+ viewBox = "0 0 20 20"
57+ fill = "currentColor"
58+ className = "w-4 h-4 text-text-gray3"
59+ >
60+ < path
61+ fillRule = "evenodd"
62+ d = "M5.23 7.21a.75.75 0 011.06.02L10 10.94l3.71-3.71a.75.75 0 111.06 1.06l-4.24 4.25a.75.75 0 01-1.06 0L5.21 8.29a.75.75 0 01.02-1.08z"
63+ clipRule = "evenodd"
64+ />
65+ </ svg >
66+ </ button >
67+ </ div >
5568 </ div >
5669 ) ;
5770}
0 commit comments