import { useId, type ReactNode } from 'react' import type { TourListItem } from '@trek/shared' import { fs } from '../shared/DialogShell' import { useTranslation } from '../../i18n' import { TourFactPills, TourGradeTile } from './tourParts' import { tourWebsitePresentation } from './tourPresentation' interface TourListRowProps { tour: TourListItem selected?: boolean disabled?: boolean onSelect: (tour: TourListItem, opener: HTMLElement) => void action?: ReactNode children?: ReactNode } /** A tour in a list, shaped like a place row: tile, name, its facts as pills and the day action on the right. */ export default function TourListRow({ tour, selected = false, disabled = false, onSelect, action, children }: TourListRowProps) { const { t } = useTranslation() const nameId = useId() const tone = selected ? 'bg-surface-selected' : disabled ? '' : 'hover:bg-surface-hover' const website = tourWebsitePresentation(tour.website) return (