refactor: extract shared utility functions to eliminate duplication

This commit is contained in:
Viktor Barzin 2026-02-28 16:02:06 +00:00
parent b720013a08
commit 1037ff164d
No known key found for this signature in database
GPG key ID: 0EB088298288D958
10 changed files with 85 additions and 110 deletions

View file

@ -4,6 +4,7 @@ import { MapPin, PoundSterling } from 'lucide-react';
import { SwipeableCardRow } from './SwipeableCardRow';
import { ListView } from './ListView';
import type { GeoJSONFeatureCollection, PropertyProperties, PropertyFeature } from '@/types';
import { formatCurrency } from '@/utils/format';
interface MobileBottomSheetProps {
listingData: GeoJSONFeatureCollection | null;
@ -14,11 +15,6 @@ interface MobileBottomSheetProps {
onSnapChange?: (snap: string | number | null) => void;
}
function formatCurrency(value: number): string {
if (value >= 1000) return `£${(value / 1000).toFixed(1)}k`;
return `£${Math.round(value)}`;
}
export function MobileBottomSheet({
listingData,
onPropertyClick,