11import { Button } from "@/app/conf/_design-system/button"
22import { clsx } from "clsx"
3+ import { GET_TICKETS_LINK } from "../../links"
34
45export interface TicketPeriodProps {
56 price : string
6- date : string
7+ date : Date | [ Date , Date ]
78 disabled ?: boolean
89 name : string
910}
@@ -17,24 +18,56 @@ export function TicketPeriod({
1718 return (
1819 < article
1920 className = { clsx (
20- "flex flex-col backdrop-blur-md [container-type:inline-size]" ,
21- ! disabled
22- ? "border border-pink-200 bg-pri-dark/[0.24]"
23- : "border-r border-pink-200/50 bg-white/[0.12] last:border-r-0" ,
21+ "@container/card flex flex-col border border-pri-lighter bg-pri-light/[0.24] backdrop-blur-md transition [&+&]:border-l-0" ,
22+ disabled && "opacity-50" ,
2423 ) }
2524 >
26- < header className = "p-6" >
25+ < header className = "border-b border-pri-lighter p-6" >
2726 < h3 className = "text-white typography-h3" > { name } </ h3 >
2827 </ header >
29- < div className = "flex flex-col gap-6 p-6 pt-0 " >
28+ < div className = "flex h-full flex-col justify-end gap-6 p-6" >
3029 < div className = "flex items-end justify-between gap-2" >
31- < span className = "text-white typography-h2" > { price } </ span >
32- < span className = "text-white typography-body-md" > { date } </ span >
30+ < span className = "@[356px]:typography-h2 text-white typography-h3" >
31+ { price }
32+ </ span >
33+ { /* eslint-disable-next-line tailwindcss/no-custom-classname */ }
34+ < span className = "ticket-period--date text-right text-white typography-body-md" >
35+ { Array . isArray ( date ) ? (
36+ < >
37+ < Time date = { date [ 0 ] } />
38+ { " - " }
39+ < Time date = { date [ 1 ] } />
40+ </ >
41+ ) : (
42+ < Time date = { date } />
43+ ) }
44+ </ span >
3345 </ div >
34- < Button variant = "primary" disabled = { disabled } className = "w-full" >
46+ < Button
47+ variant = "primary"
48+ disabled = { disabled }
49+ className = "light w-full"
50+ href = { GET_TICKETS_LINK }
51+ >
3552 Get a ticket
3653 </ Button >
3754 </ div >
3855 </ article >
3956 )
4057}
58+
59+ function Time ( { date } : { date : Date } ) {
60+ return (
61+ < time
62+ dateTime = { date . toISOString ( ) }
63+ dangerouslySetInnerHTML = { {
64+ __html : date
65+ . toLocaleDateString ( "en-GB" , {
66+ month : "long" ,
67+ day : "numeric" ,
68+ } )
69+ . replace ( " " , " " ) ,
70+ } }
71+ />
72+ )
73+ }
0 commit comments