frontend refactor
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
import { memo } from 'react';
|
||||
import { MapPin, Phone } from 'lucide-react';
|
||||
import type { Delivery } from '../../types';
|
||||
import { pickupLocationLabels } from '../../types';
|
||||
@@ -10,7 +11,7 @@ interface DeliveryRowProps {
|
||||
onDelete: (id: string) => void;
|
||||
}
|
||||
|
||||
export const DeliveryRow = ({ delivery, onStatusChange, onEdit, onDelete }: DeliveryRowProps) => {
|
||||
export const DeliveryRow = memo(({ delivery, onStatusChange, onEdit, onDelete }: DeliveryRowProps) => {
|
||||
const handleAddressClick = (e: React.MouseEvent) => {
|
||||
e.stopPropagation();
|
||||
const encodedAddress = encodeURIComponent(delivery.address);
|
||||
@@ -75,4 +76,6 @@ export const DeliveryRow = ({ delivery, onStatusChange, onEdit, onDelete }: Deli
|
||||
</td>
|
||||
</tr>
|
||||
);
|
||||
};
|
||||
});
|
||||
|
||||
DeliveryRow.displayName = 'DeliveryRow';
|
||||
|
||||
Reference in New Issue
Block a user