Refactor park detail address display

Implement the plan to refactor the address display in the park detail page. This includes updating the sidebar address to show the street address on its own line, followed by city, state, and postal code on the next line, and the country on a separate line. This change aims to create a more compact and natural address format.
This commit is contained in:
gpt-engineer-app[bot]
2025-11-06 14:03:58 +00:00
parent 98fbc94476
commit fc7c2d5adc
5 changed files with 29 additions and 9 deletions

View File

@@ -1,6 +1,7 @@
import { useState, useEffect } from 'react';
import { useDebouncedValue } from '@/hooks/useDebouncedValue';
import { useGlobalSearch } from '@/hooks/search/useGlobalSearch';
import { formatLocationShort } from '@/lib/locationFormatter';
import { Card, CardContent } from '@/components/ui/card';
import { Badge } from '@/components/ui/badge';
import { Button } from '@/components/ui/button';
@@ -87,7 +88,7 @@ export function SearchResults({ query, onClose }: SearchResultsProps) {
switch (result.type) {
case 'park':
const park = result.data as Park;
return park.location ? `${park.location.city}, ${park.location.country}` : 'Theme Park';
return park.location ? formatLocationShort(park.location) : 'Theme Park';
case 'ride':
const ride = result.data as Ride;
return ride.park && typeof ride.park === 'object' && 'name' in ride.park