@@ -3,6 +3,7 @@ import { Box, Button, Flex, Image, Text } from "@chakra-ui/react"
33import { useColorModeValue } from "@/components/ui/color-mode"
44
55type MarketKey = "home" | "draw" | "away"
6+ type OverUnderKey = "over" | "under"
67
78interface BookInfo {
89 name : string
@@ -24,6 +25,16 @@ export interface OddsCardProps {
2425 onSelect ?: ( market : MarketKey ) => void
2526}
2627
28+ export interface OverUnderOddsCardProps {
29+ homeTeam : string
30+ awayTeam : string
31+ marketLabel ?: string
32+ line ?: string
33+ over : Market
34+ under : Market
35+ onSelect ?: ( market : OverUnderKey ) => void
36+ }
37+
2738interface OddsPillProps extends Market {
2839 label : string
2940 onSelect ?: ( ) => void
@@ -118,7 +129,7 @@ export function OddsCard({
118129
119130 return (
120131 < Box
121- borderWidth = "4px "
132+ borderWidth = "1px "
122133 borderRadius = "2xl"
123134 borderColor = { borderColor }
124135 bg = { wrapperBg }
@@ -183,4 +194,87 @@ export function OddsCard({
183194 )
184195}
185196
197+ export function OverUnderOddsCard ( {
198+ homeTeam,
199+ awayTeam,
200+ marketLabel = "Total" ,
201+ line,
202+ over,
203+ under,
204+ onSelect,
205+ } : OverUnderOddsCardProps ) {
206+ const wrapperBg = useColorModeValue ( "gray.50" , "gray.800" )
207+ const borderColor = useColorModeValue ( "gray.200" , "gray.600" )
208+
209+ return (
210+ < Box
211+ borderWidth = "1px"
212+ borderRadius = "2xl"
213+ borderColor = { borderColor }
214+ bg = { wrapperBg }
215+ px = { 10 }
216+ py = { 50 }
217+ w = "full"
218+ maxW = "5xl"
219+ >
220+ < Flex
221+ direction = { { base : "column" , sm : "row" } }
222+ justify = "space-between"
223+ align = { { base : "stretch" , sm : "center" } }
224+ gap = { 6 }
225+ >
226+ < Flex
227+ direction = { { base : "column" , md : "row" } }
228+ align = "center"
229+ justify = "center"
230+ gap = { 4 }
231+ minW = { { base : "full" , md : "sm" } }
232+ >
233+ < Text
234+ fontSize = "2xl"
235+ fontWeight = "semibold"
236+ textAlign = { { base : "center" , md : "right" } }
237+ lineHeight = "short"
238+ >
239+ { homeTeam }
240+ </ Text >
241+ < Box
242+ px = { 3 }
243+ py = { 1 }
244+ borderRadius = "full"
245+ bg = "teal.600"
246+ color = "white"
247+ fontWeight = "bold"
248+ fontSize = "sm"
249+ >
250+ VS
251+ </ Box >
252+ < Text
253+ fontSize = "2xl"
254+ fontWeight = "semibold"
255+ textAlign = { { base : "center" , md : "left" } }
256+ lineHeight = "short"
257+ >
258+ { awayTeam }
259+ </ Text >
260+ </ Flex >
261+ < Flex direction = "column" align = "center" justify = "center" w = "full" maxW = "2xl" gap = { 4 } >
262+ < Text fontSize = "sm" fontWeight = "medium" color = "teal.600" textTransform = "uppercase" >
263+ { marketLabel }
264+ </ Text >
265+ { line && (
266+ < Text fontSize = "3xl" fontWeight = "semibold" color = "fg.default" >
267+ { line }
268+ </ Text >
269+ ) }
270+ < Flex justify = "space-evenly" align = "center" gap = { 10 } w = "full" >
271+ < MarketColumn title = "OVER" market = { over } onSelect = { ( ) => onSelect ?.( "over" ) } />
272+ < MarketColumn title = "UNDER" market = { under } onSelect = { ( ) => onSelect ?.( "under" ) } />
273+ </ Flex >
274+ </ Flex >
275+ </ Flex >
276+ </ Box >
277+ )
278+ }
279+
186280export default OddsCard
0 commit comments