-}
-
-function TourActionButton({ buttonRef, onClick, icon, label, primary = false, danger = false }: { buttonRef?: React.Ref; onClick: () => void; icon: React.ReactNode; label: string; primary?: boolean; danger?: boolean }) {
- const className = primary ? 'bg-accent text-accent-text' : danger ? 'text-danger hover:bg-danger-subtle' : 'text-content-secondary hover:bg-surface-hover'
- return {icon}{label}
+/** Markdown in a framed box, like the inspector's; long words wrap instead of widening the card. */
+function MarkdownBox({ children }: { children: string }) {
+ return (
+
+ {children}
+
+ )
}
diff --git a/client/src/components/Tours/TourListRow.tsx b/client/src/components/Tours/TourListRow.tsx
index b07ceee79..d6390a1ea 100644
--- a/client/src/components/Tours/TourListRow.tsx
+++ b/client/src/components/Tours/TourListRow.tsx
@@ -1,10 +1,7 @@
-import type { ReactNode } from 'react'
+import { useId, type ReactNode } from 'react'
import type { TourListItem } from '@trek/shared'
-import { AlertTriangle, ArrowDown, ArrowUp } from 'lucide-react'
-import { useTranslation } from '../../i18n'
-import { useSettingsStore } from '../../store/settingsStore'
-import { formatDistance, formatElevation } from '../../utils/units'
-import { hikeSourceBadgeLabel } from './tourPresentation'
+import { fs } from '../shared/DialogShell'
+import { TourFactPills, TourTile } from './tourParts'
interface TourListRowProps {
tour: TourListItem
@@ -15,65 +12,38 @@ interface TourListRowProps {
children?: ReactNode
}
-/** Shared Tours list row used by both the ADD flow and the planner workspace. */
+/** 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 distanceUnit = useSettingsStore(state => state.settings.distance_unit)
-
+ const nameId = useId()
+ const tone = selected ? 'bg-surface-selected' : disabled ? '' : 'hover:bg-surface-hover'
return (
{ if (!disabled) onSelect(tour, event.currentTarget) }}
onKeyDown={event => {
- if (disabled) return
+ if (disabled || event.target !== event.currentTarget) return
if (event.key === 'Enter' || event.key === ' ') {
event.preventDefault()
onSelect(tour, event.currentTarget)
}
}}
- onMouseEnter={event => { if (!selected) event.currentTarget.style.background = 'var(--bg-hover)' }}
- onMouseLeave={event => { if (!selected) event.currentTarget.style.background = 'transparent' }}
>
-