@@ -8,6 +8,8 @@ import { ProjectListData } from '@/types/project.type';
88import { useSelector } from 'react-redux' ;
99import { RootState } from '@/store/redux/store' ;
1010import { BeatLoader } from 'react-spinners' ;
11+ import TableListCard from '@/pages/project/_components/responsive_tableListCard/TableListCard' ;
12+ import ScrollToTopButton from '@/components/ui/scrollTopButton/ScrollToTopButton' ;
1113
1214const columns = [
1315 { id : 'projectName' , label : '프로젝트 명' } ,
@@ -45,60 +47,75 @@ export default function ProjectMangePage() {
4547 if ( isError ) return < div > 오류가 발생했습니다.</ div > ;
4648
4749 return (
48- < div className = "w-[90%] flex flex-col m-auto" >
49- < ProjectTitle />
50- { projects . length === 0 ? (
51- < div className = "w-full text-center py-20 text-typography-gray text-16 font-medium" >
52- < p > 검색 결과가 없습니다.</ p >
53- </ div >
54- ) : (
55- < TableItem
56- columns = { columns }
57- items = { projects }
58- onItemClick = { handleItemClick }
59- className = "w-full"
60- renderCell = { ( column , item ) => {
61- if ( column . id === 'projectStatus' ) {
62- return < StatusBadge status = { item . projectStatus } /> ;
63- }
64- if ( column . id === 'projectMember' ) {
65- return (
66- < div className = "flex -space-x-1 overflow-hidden" >
67- < img
68- className = "inline-block size-6 rounded-full ring-2 ring-white"
69- src = "https://images.unsplash.com/photo-1491528323818-fdd1faba62cc?ixlib=rb-1.2.1& ixid = eyJhcHBfaWQiOjEyMDd9 & auto = format & fit = facearea & facepad = 2 & w = 256 & h = 256 & q = 80 "
70- alt = ""
71- />
72- < img
73- className = "inline-block size-6 rounded-full ring-2 ring-white"
74- src = "https://images.unsplash.com/photo-1550525811-e5869dd03032?ixlib=rb-1.2.1& auto = format & fit = facearea & facepad = 2 & w = 256 & h = 256 & q = 80 "
75- alt = ""
76- />
77- < img
78- className = "inline-block size-6 rounded-full ring-2 ring-white"
79- src = "https://images.unsplash.com/photo-1500648767791-00dcc994a43e?ixlib=rb-1.2.1& ixid = eyJhcHBfaWQiOjEyMDd9 & auto = format & fit = facearea & facepad = 2.25 & w = 256 & h = 256 & q = 80 "
80- alt = ""
81- />
82- < img
83- className = "inline-block size-6 rounded-full ring-2 ring-white"
84- src = "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1& ixid = eyJhcHBfaWQiOjEyMDd9 & auto = format & fit = facearea & facepad = 2 & w = 256 & h = 256 & q = 80 "
85- alt = ""
86- />
87- </ div >
88- ) ;
89- }
90- if ( column . id === 'testRate' ) {
91- if ( item . testRate === null ) {
92- return < span > -</ span > ;
93- } else {
94- return < span > { item . testRate } %</ span > ;
95- }
96- }
50+ < >
51+ < div className = "w-[90%] flex flex-col m-auto" >
52+ < ProjectTitle />
53+ { projects . length === 0 ? (
54+ < div className = "w-full text-center py-20 text-typography-gray text-16 font-medium" >
55+ < p > 검색 결과가 없습니다.</ p >
56+ </ div >
57+ ) : (
58+ < >
59+ < div className = "hidden md:block" >
60+ < TableItem
61+ columns = { columns }
62+ items = { projects }
63+ onItemClick = { handleItemClick }
64+ className = "w-full"
65+ renderCell = { ( column , item ) => {
66+ if ( column . id === 'projectStatus' ) {
67+ return < StatusBadge status = { item . projectStatus } /> ;
68+ }
69+ if ( column . id === 'projectMember' ) {
70+ return (
71+ < div className = "flex -space-x-1 overflow-hidden" >
72+ < img
73+ className = "inline-block size-6 rounded-full ring-2 ring-white"
74+ src = "https://images.unsplash.com/photo-1491528323818-fdd1faba62cc?ixlib=rb-1.2.1& ixid = eyJhcHBfaWQiOjEyMDd9 & auto = format & fit = facearea & facepad = 2 & w = 256 & h = 256 & q = 80 "
75+ alt = ""
76+ />
77+ < img
78+ className = "inline-block size-6 rounded-full ring-2 ring-white"
79+ src = "https://images.unsplash.com/photo-1550525811-e5869dd03032?ixlib=rb-1.2.1& auto = format & fit = facearea & facepad = 2 & w = 256 & h = 256 & q = 80 "
80+ alt = ""
81+ />
82+ < img
83+ className = "inline-block size-6 rounded-full ring-2 ring-white"
84+ src = "https://images.unsplash.com/photo-1500648767791-00dcc994a43e?ixlib=rb-1.2.1& ixid = eyJhcHBfaWQiOjEyMDd9 & auto = format & fit = facearea & facepad = 2.25 & w = 256 & h = 256 & q = 80 "
85+ alt = ""
86+ />
87+ < img
88+ className = "inline-block size-6 rounded-full ring-2 ring-white"
89+ src = "https://images.unsplash.com/photo-1472099645785-5658abf4ff4e?ixlib=rb-1.2.1& ixid = eyJhcHBfaWQiOjEyMDd9 & auto = format & fit = facearea & facepad = 2 & w = 256 & h = 256 & q = 80 "
90+ alt = ""
91+ />
92+ </ div >
93+ ) ;
94+ }
95+ if ( column . id === 'testRate' ) {
96+ if ( item . testRate === null ) {
97+ return < span > -</ span > ;
98+ } else {
99+ return < span > { item . testRate } %</ span > ;
100+ }
101+ }
97102
98- return item [ column . id as keyof typeof item ] ;
99- } }
100- />
101- ) }
102- </ div >
103+ return item [ column . id as keyof typeof item ] ;
104+ } }
105+ />
106+ </ div >
107+
108+ { /* md(768px) 이하 사이즈일 때 카드 형태로 변경 */ }
109+ < div className = "md:hidden grid grid-cols-2 max-sm:grid-cols-1 gap-4" >
110+ { projects . map ( ( project : ProjectListData ) => (
111+ < TableListCard key = { project . projectId } project = { project } onClick = { ( ) => handleItemClick ( project ) } />
112+ ) ) }
113+ </ div >
114+ </ >
115+ ) }
116+ </ div >
117+
118+ < ScrollToTopButton />
119+ </ >
103120 ) ;
104121}
0 commit comments