Showing AI reviews for website
Project AI Score ?
71%
Quality Avg ?
72%
Security Avg ?
74%
Reviews ?
123

Review Result ?

solutionbowl/website · 032e7442
The commit introduces logic to conditionally render jersey images and adjust associated grid layouts based on market types and fancy types, improving the user interface for specific markets. The changes enhance visual consistency and cater to business requirements for the 'fancy market' view. However, some logic is repeated and naming could be clearer, which affects maintainability.
Quality ?
80%
Security ?
90%
Business Value ?
70%
Maintainability ?
85%
Issues & Suggested Fixes ?
1AI detects the issue
2Shows file, line, or evidence
3Suggests the fix to apply
Duplicate Logic
Where src/components/racing/HorseRow.tsx:93-96
Issue / Evidence repeated predicates for 'isJerseyFallbackMarket' use differing variables (normalizedFancyType vs marketType) ambiguously
Suggested Fix unify naming and logic for clarity and to prevent potential bugs
Multiple Conditional Grid Templates And Je...
Where src/components/racing/HorseRow.tsx:590-883
Issue / Evidence multiple conditional grid templates and jersey avatar renders are similar
Suggested Fix consider extracting reusable components or helper functions to reduce duplication and improve readability
Inconsistent Capitalization Usage For Mark...
Where src/components/racing/MarketCard.tsx:235-243
Issue / Evidence inconsistent capitalization usage for market type and fancy type (toUpperCase in HorseRow, toLowerCase here)
Suggested Fix unify approach to avoid subtle bugs
Vague And Underspecified
Where commit message
Issue / Evidence vague and underspecified
Suggested Fix expand description to clarify the purpose, affected components, and business impact to improve traceability and review effectiveness
Code Change Preview · src/components/racing/HorseRow.tsx ?
Removed / Before Commit
- diff --git a/src/components/racing/HorseRow.tsx b/src/components/racing/HorseRow.tsx
- index 9ebc805..53e13b4 100644
- 
- const marketNameLower = marketName?.toLowerCase() || ''
- const isWinnerMarket = marketNameLower.includes('winner') || marketNameLower.includes('win')
-   const normalizedMarketType = marketType?.trim().toUpperCase()
- const normalizedFancyType = fancyType?.trim().toLowerCase()
- const isPhotoFancyMarket = normalizedMarketType === 'FANCY' && normalizedFancyType === 'photo'
- const isPhotoMarket = normalizedFancyType === 'photo' || normalizedMarketType === 'PHOTO'
- const isObjectionMarket = normalizedFancyType === 'objection' || normalizedMarketType === 'OBJECTION'
- const jerseyImageUrl = runner.jersey || runner.runner?.jersey
- const [jerseyImageFailed, setJerseyImageFailed] = useState(false)
- const shouldShowJerseyImage = Boolean(jerseyImageUrl && !jerseyImageFailed)
- 
- useEffect(() => {
- setJerseyImageFailed(false)
- <div
- className="grid min-h-[68px] px-[10px] py-[10px] items-center gap-[6px]"
Added / After Commit
+ diff --git a/src/components/racing/HorseRow.tsx b/src/components/racing/HorseRow.tsx
+ index 9ebc805..53e13b4 100644
+ 
+ const marketNameLower = marketName?.toLowerCase() || ''
+ const isWinnerMarket = marketNameLower.includes('winner') || marketNameLower.includes('win')
+   const normalizedMarketType = marketType?.trim().toUpperCase() || ''
+ const normalizedFancyType = fancyType?.trim().toLowerCase()
+   const isJerseyFallbackMarket =
+     normalizedFancyType === 'photo' ||
+     normalizedMarketType === 'WIN' ||
+     normalizedMarketType.includes('PLACE')
+ const isPhotoFancyMarket = normalizedMarketType === 'FANCY' && normalizedFancyType === 'photo'
+ const isPhotoMarket = normalizedFancyType === 'photo' || normalizedMarketType === 'PHOTO'
+ const isObjectionMarket = normalizedFancyType === 'objection' || normalizedMarketType === 'OBJECTION'
+ const jerseyImageUrl = runner.jersey || runner.runner?.jersey
+ const [jerseyImageFailed, setJerseyImageFailed] = useState(false)
+ const shouldShowJerseyImage = Boolean(jerseyImageUrl && !jerseyImageFailed)
+   const shouldRenderJerseySlot = shouldShowJerseyImage || isJerseyFallbackMarket
Removed / Before Commit
- diff --git a/src/components/racing/MarketCard.tsx b/src/components/racing/MarketCard.tsx
- index cde5adf..c21d97b 100644
- const showBlockBetting = isWinnerBlockMarket(market)
- const isMobile = typeof window !== "undefined" && window.innerWidth < 768
- 
-   const showJerseySlot = true
- 
- const mobileBlockBetGridColumns = isToteMarket
- ? "minmax(0, 1fr) 60px"
- className="grid px-[14px] py-[8px]"
- style={{
- gridTemplateColumns: showBlockBetting
-                     ? `auto ${blockBetGridColumns}`
- : window.innerWidth >= 768
- ? isToteMarket 
-                         ? "auto 1fr 130px"
-                         : "auto 1fr 130px 130px"
- : isToteMarket 
Added / After Commit
+ diff --git a/src/components/racing/MarketCard.tsx b/src/components/racing/MarketCard.tsx
+ index cde5adf..c21d97b 100644
+ const showBlockBetting = isWinnerBlockMarket(market)
+ const isMobile = typeof window !== "undefined" && window.innerWidth < 768
+ 
+   const hasAnyJerseyImage = market.odds.some(runner => 
+     runner.jersey || runner.runner?.jersey
+   )
+   const normalizedJerseyMarketType = market.marketType?.trim().toUpperCase() || ''
+   const showJerseySlot =
+     hasAnyJerseyImage ||
+     (market.fancy_type || market.fancyType)?.trim().toLowerCase() === 'photo' ||
+     normalizedJerseyMarketType === 'WIN' ||
+     normalizedJerseyMarketType.includes('PLACE')
+ 
+ const mobileBlockBetGridColumns = isToteMarket
+ ? "minmax(0, 1fr) 60px"
+ className="grid px-[14px] py-[8px]"