GameDetails component displays comprehensive information about a game, including cover art, stats, and action buttons.
Import
Basic usage
Props
Game object to display. Uses the same
Game interface as GameCard.Called when the user clicks the “Play Now” button.
Called when the user clicks the “Settings” button. If not provided, the settings button is hidden.
Additional CSS classes to apply to the root element.
Layout sections
Header with cover art
- Large cover art (192×256px)
- Game title (3xl font, bold)
- Platform icon and name
- Genre badge
- Action buttons (Play Now, Settings)
Stats cards
Three stat cards displayed in a grid:- Play time - Formatted as hours/minutes or “Never played”
- Last played - Relative time (“Today”, “Yesterday”, “3 days ago”)
- ROM path - Filename with full path on hover
About section
Placeholder card for future metadata integration.Examples
Basic details
With settings handler
Custom styling
Time formatting
Play time
- Never played:
"Never played" - Less than 1 hour:
"45m" - 1+ hours:
"2h 30m"
Last played
- Today:
"Today" - Yesterday:
"Yesterday" - Less than 7 days:
"3 days ago" - Less than 30 days:
"2 weeks ago" - 30+ days: Full date (locale-formatted)
Component structure
packages/ui/components/GameDetails.tsx
Icons used
Play- Play Now buttonSettings- Settings buttonClock- Play time statCalendar- Last played statHardDrive- ROM path statInfo- Placeholder when no cover art
All icons are from the
lucide-react package.Future enhancements
The “About this game” section is a placeholder for:- Game description from metadata services
- Release date
- Developer/publisher
- Screenshots
- Achievement progress