import React from 'react'; import Box from '@mui/material/Box'; import type { SxProps, Theme } from '@mui/material/styles'; import LocationOnOutlinedIcon from '@mui/icons-material/LocationOnOutlined'; import StarRoundedIcon from '@mui/icons-material/StarRounded'; import { Card } from '../../atoms/Card'; import { Typography } from '../../atoms/Typography'; // ─── Types ─────────────────────────────────────────────────────────────────── /** Props for the FA ProviderCardCompact molecule */ export interface ProviderCardCompactProps { /** Provider display name */ name: string; /** Location text (suburb, city) */ location: string; /** Hero image URL — shown on the left */ imageUrl?: string; /** Average rating (e.g. 4.5). Omit to hide. */ rating?: number; /** Number of reviews. Omit to hide review count. */ reviewCount?: number; /** Click handler — makes the card interactive */ onClick?: () => void; /** MUI sx prop for the root element */ sx?: SxProps; } // ─── Component ─────────────────────────────────────────────────────────────── /** * Compact horizontal provider card for the FA design system. * * Used at the top of the Package Select page to show which provider * the user has selected. Horizontal layout with image on the left, * name + meta on the right. * * For the full vertical listing card, use ProviderCard instead. * * Composes Card + Typography. * * Usage: * ```tsx * * ``` */ export const ProviderCardCompact = React.forwardRef( ({ name, location, imageUrl, rating, reviewCount, onClick, sx }, ref) => { return ( {/* Image */} {imageUrl && ( )} {/* Content */} {name} {/* Location */} {location} {/* Rating */} {rating != null && ( {rating} Rating {reviewCount != null ? ` (${reviewCount} ${reviewCount === 1 ? 'Review' : 'Reviews'})` : ''} )} ); }, ); ProviderCardCompact.displayName = 'ProviderCardCompact'; export default ProviderCardCompact;