history orders image food
This commit is contained in:
@@ -16,11 +16,17 @@ import { HistoryOrderItem } from './types/Types';
|
||||
|
||||
const fallbackImage = '/assets/images/food-preview.png';
|
||||
|
||||
const getFoodImage = (images: string | null | undefined): string => {
|
||||
if (!images || typeof images !== 'string') {
|
||||
const getFoodImage = (images: string[] | string | null | undefined): string => {
|
||||
if (!images) {
|
||||
return fallbackImage;
|
||||
}
|
||||
if (Array.isArray(images)) {
|
||||
return images.length > 0 ? images[0] : fallbackImage;
|
||||
}
|
||||
if (typeof images === 'string') {
|
||||
return images;
|
||||
}
|
||||
return fallbackImage;
|
||||
};
|
||||
|
||||
const formatDate = (dateString: string): string => {
|
||||
|
||||
@@ -117,7 +117,7 @@ export interface HistoryOrderFood {
|
||||
stock: number;
|
||||
stockDefault: number;
|
||||
isActive: boolean;
|
||||
images: string | null;
|
||||
images: string[] | null;
|
||||
inPlaceServe: boolean;
|
||||
pickupServe: boolean;
|
||||
rate: number;
|
||||
|
||||
@@ -42,7 +42,7 @@ function PerformantTabRenderer({ children, rowHeight = 100, ...rest }: Props) {
|
||||
<ul
|
||||
{...rest}
|
||||
style={{
|
||||
height: (rowHeight * (children.length - 1)),
|
||||
height: (rowHeight * children.length),
|
||||
paddingTop: 16,
|
||||
}}
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user