history orders image food

This commit is contained in:
hamid zarghami
2025-12-06 12:24:16 +03:30
parent b46df18025
commit eb9ecfa760
3 changed files with 11 additions and 5 deletions
+8 -2
View File
@@ -16,11 +16,17 @@ import { HistoryOrderItem } from './types/Types';
const fallbackImage = '/assets/images/food-preview.png'; const fallbackImage = '/assets/images/food-preview.png';
const getFoodImage = (images: string | null | undefined): string => { const getFoodImage = (images: string[] | string | null | undefined): string => {
if (!images || typeof images !== 'string') { if (!images) {
return fallbackImage; return fallbackImage;
} }
if (Array.isArray(images)) {
return images.length > 0 ? images[0] : fallbackImage;
}
if (typeof images === 'string') {
return images; return images;
}
return fallbackImage;
}; };
const formatDate = (dateString: string): string => { const formatDate = (dateString: string): string => {
@@ -117,7 +117,7 @@ export interface HistoryOrderFood {
stock: number; stock: number;
stockDefault: number; stockDefault: number;
isActive: boolean; isActive: boolean;
images: string | null; images: string[] | null;
inPlaceServe: boolean; inPlaceServe: boolean;
pickupServe: boolean; pickupServe: boolean;
rate: number; rate: number;
+1 -1
View File
@@ -42,7 +42,7 @@ function PerformantTabRenderer({ children, rowHeight = 100, ...rest }: Props) {
<ul <ul
{...rest} {...rest}
style={{ style={{
height: (rowHeight * (children.length - 1)), height: (rowHeight * children.length),
paddingTop: 16, paddingTop: 16,
}} }}
> >