@@ -5,14 +5,18 @@ interface ResultCardProps {
55 index ?: number ;
66}
77
8+ function isUnknown ( value : string | undefined ) : boolean {
9+ return ! value || value . toLowerCase ( ) === "unknown" ;
10+ }
11+
812function DetailCell ( {
913 label,
1014 value,
1115} : {
1216 label : string ;
1317 value : string ;
1418} ) {
15- if ( ! value ) return null ;
19+ if ( isUnknown ( value ) ) return null ;
1620 return (
1721 < div >
1822 < p className = "mb-0.5 text-xs uppercase tracking-wider text-white/40" >
@@ -40,14 +44,14 @@ export function ResultCard({ ticket, index = 0 }: ResultCardProps) {
4044 </ span >
4145
4246 { /* Event name */ }
43- { ticket . eventName && (
47+ { ! isUnknown ( ticket . eventName ) && (
4448 < h3 className = "truncate text-base font-semibold text-white" >
4549 { ticket . eventName }
4650 </ h3 >
4751 ) }
4852
4953 { /* Venue + city */ }
50- { ( ticket . venue || ticket . city ) && (
54+ { ( ! isUnknown ( ticket . venue ) || ! isUnknown ( ticket . city ) ) && (
5155 < p className = "mt-0.5 flex items-center gap-1 text-sm text-white/60" >
5256 < svg
5357 className = "h-3.5 w-3.5 flex-shrink-0"
@@ -68,20 +72,22 @@ export function ResultCard({ ticket, index = 0 }: ResultCardProps) {
6872 d = "M15 11a3 3 0 11-6 0 3 3 0 016 0z"
6973 />
7074 </ svg >
71- { [ ticket . venue , ticket . city ] . filter ( Boolean ) . join ( " · " ) }
75+ { [ ticket . venue , ticket . city ] . filter ( v => ! isUnknown ( v ) ) . join ( " · " ) }
7276 </ p >
7377 ) }
7478 </ div >
7579
7680 { /* Price — prominent */ }
7781 < div className = "flex-shrink-0 text-right" >
78- < p className = "text-xl font-bold text-white" >
79- { ticket . currency && ticket . currency !== ticket . price . slice ( 0 , 1 )
80- ? `${ ticket . currency } `
81- : "" }
82- { ticket . price }
83- </ p >
84- { ticket . ticketType && (
82+ { ! isUnknown ( ticket . price ) && (
83+ < p className = "text-xl font-bold text-white" >
84+ { ticket . currency && ticket . currency !== ticket . price . slice ( 0 , 1 )
85+ ? `${ ticket . currency } `
86+ : "" }
87+ { ticket . price }
88+ </ p >
89+ ) }
90+ { ticket . ticketType && ticket . ticketType !== "Unknown" && (
8591 < p className = "text-xs text-white/50" > { ticket . ticketType } </ p >
8692 ) }
8793 </ div >
@@ -91,15 +97,9 @@ export function ResultCard({ ticket, index = 0 }: ResultCardProps) {
9197 < div className = "mb-4 grid grid-cols-3 gap-4 border-t border-white/5 pt-4" >
9298 < DetailCell label = "Section" value = { ticket . section } />
9399 < DetailCell label = "Row" value = { ticket . row } />
94- { ticket . seats ?. toLowerCase ( ) !== "unknown" && (
95- < DetailCell label = "Seats" value = { ticket . seats } />
96- ) }
97- { ticket . quantity && (
98- < DetailCell label = "Qty" value = { ticket . quantity } />
99- ) }
100- { ticket . eventDate && (
101- < DetailCell label = "Date" value = { ticket . eventDate } />
102- ) }
100+ < DetailCell label = "Seats" value = { ticket . seats } />
101+ < DetailCell label = "Qty" value = { ticket . quantity } />
102+ < DetailCell label = "Date" value = { ticket . eventDate } />
103103 </ div >
104104
105105 { /* Notes */ }
0 commit comments