refactor: extract shared utility functions to eliminate duplication
This commit is contained in:
parent
b720013a08
commit
1037ff164d
10 changed files with 85 additions and 110 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue