11import { useEffect , useState } from 'react' ;
22import { useNavigate , useParams } from 'react-router' ;
33import { toast } from 'sonner' ;
4+ import EventDetailContent from '../components/EventDetailContent' ;
5+ import GuestSummaryList from '../components/GuestSummaryList' ;
46import type { Events } from '../types/schema' ;
5- import { formatEventDate } from '../utils/date' ;
67// import useAuth from '../hooks/useAuth';
78
89// shadcn UI μ»΄ν¬λνΈ
@@ -17,15 +18,13 @@ import {
1718 AlertDialogTitle ,
1819 AlertDialogTrigger ,
1920} from '@/components/ui/alert-dialog' ;
20- import { Avatar , AvatarFallback , AvatarImage } from '@/components/ui/avatar' ;
2121import { Button } from '@/components/ui/button' ;
2222import {
2323 DropdownMenu ,
2424 DropdownMenuContent ,
2525 DropdownMenuItem ,
2626 DropdownMenuTrigger ,
2727} from '@/components/ui/dropdown-menu' ;
28- import { ScrollArea } from '@/components/ui/scroll-area' ;
2928
3029// SVG μμ΄μ½ μ»΄ν¬λνΈ
3130const IconChevronLeft = ( ) => (
@@ -204,45 +203,11 @@ export default function Event() {
204203
205204 { /* 2. λ©μΈ μ½ν
μΈ */ }
206205 < div className = "max-w-2xl min-w-[320px] mx-auto w-[90%] px-6 flex flex-col items-start gap-10" >
207- { /* μΌμ μ 보 (μΌμͺ½ μ λ ¬) */ }
208- < div className = "text-left space-y-3 w-full" >
209- < p className = "text-lg sm:text-xl font-bold text-black" >
210- μΌμ { formatEventDate ( schedule . start_at ) }
211- </ p >
212- < p className = "text-lg sm:text-xl font-bold text-black" >
213- μ₯μ { schedule . location || 'λ―Έμ ' }
214- </ p >
215- </ div >
216-
217- { /* μ μ² νν© λ²νΌ */ }
218- < button
219- onClick = { ( ) => navigate ( 'guests' ) }
220- className = "flex items-center text-lg font-bold group hover:opacity-70 transition-opacity"
221- >
222- { schedule . capacity } λͺ
μ€{ ' ' }
223- < span className = "text-black ml-2 font-extrabold" >
224- { /* μ μ² μΈμ νλ νμ */ } 8λͺ
μ μ²
225- </ span >
226- < div className = "rotate-180 ml-2 group-hover:translate-x-1 transition-transform text-black" >
227- < IconChevronLeft />
228- </ div >
229- </ button >
230-
231- { /* μμΈ μ€λͺ
*/ }
232- < ScrollArea className = "h-40 w-full rounded-md border-none" >
233- < p className = "text-base text-gray-500 leading-relaxed whitespace-pre-wrap pr-4" >
234- { schedule . description }
235- </ p >
236- </ ScrollArea >
206+ { /* μΌμ μ 보 */ }
207+ < EventDetailContent schedule = { schedule } />
237208
238209 { /* λͺ¨μ§ λ§κ° λ° λ§ν¬ λΈλ‘ */ }
239210 < div className = "w-full flex flex-col items-start" >
240- < p className = "text-lg font-bold mb-6 text-black" >
241- { schedule . registration_deadline
242- ? `${ formatEventDate ( schedule . registration_deadline ) } λͺ¨μ§ λ§κ°`
243- : 'μμ λͺ¨μ§' }
244- </ p >
245-
246211 < div className = "w-full bg-[#F8F9FA] rounded-3xl p-10 flex flex-col items-center gap-6 border border-gray-100" >
247212 < div className = "flex flex-col items-center gap-4 text-center" >
248213 < div className = "text-gray-400 scale-125" >
@@ -263,40 +228,11 @@ export default function Event() {
263228 </ div >
264229
265230 { /* μ°Έμ¬μ λͺ
λ¨ μΉμ
*/ }
266- < div className = "w-full" >
267- < div className = "flex justify-between items-center mb-8 px-2" >
268- < h2 className = "font-bold text-2xl text-black" >
269- { /* μ μ² μΈμ νλ νμ */ }
270- μ°Έμ¬μ λͺ
λ¨(8)
271- </ h2 >
272- < Button
273- variant = "link"
274- onClick = { ( ) => navigate ( 'guests' ) }
275- className = "text-base font-bold text-black p-0 h-auto"
276- >
277- λ보기
278- </ Button >
279- </ div >
280-
281- { /* λ§ν¬ λ³΅μ¬ λΈλ‘κ³Ό κ°μ λλΉμ λͺ
λ¨ λ°μ€ */ }
282- < div className = "border-2 border-black p-10 bg-white" >
283- < div className = "grid grid-cols-4 gap-8" >
284- { displayGuests . map ( ( p , idx ) => (
285- < div key = { idx } className = "flex flex-col items-center gap-4" >
286- < Avatar className = "w-16 h-16 border-none" >
287- < AvatarImage src = { p . img } />
288- < AvatarFallback className = "bg-black text-white text-xs" >
289- { p . name }
290- </ AvatarFallback >
291- </ Avatar >
292- < span className = "text-sm font-bold text-gray-700" >
293- { p . name }
294- </ span >
295- </ div >
296- ) ) }
297- </ div >
298- </ div >
299- </ div >
231+ < GuestSummaryList
232+ guests = { displayGuests }
233+ totalCount = { 8 }
234+ eventId = { schedule . id }
235+ />
300236 </ div >
301237 </ div >
302238 ) ;
0 commit comments