@homefile/components-v2 2.39.12 → 2.39.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -22,7 +22,7 @@ export const GroupCard = (_a) => {
22
22
  var { items, menuItems, onAddItem, onAddImage, onClickDelete, onClickDetails, title, totalAmount, disabled, itemsDisabled } = _a, props = __rest(_a, ["items", "menuItems", "onAddItem", "onAddImage", "onClickDelete", "onClickDetails", "title", "totalAmount", "disabled", "itemsDisabled"]);
23
23
  const { filteredResults, handleAddItem, handleChange, isItemsEmpty, searchValue, totalAmountFormatted, } = useGroupCard({ items, onAddItem, title, totalAmount });
24
24
  const groupTitle = title;
25
- return (_jsx(TileTooltip, { label: title, children: _jsxs(Box, { backgroundColor: "lightBlue.1", boxShadow: "base", w: "100%", children: [_jsx(GroupCardHeader, { menuItems: menuItems, title: title, totalAmount: totalAmountFormatted }), _jsxs(Flex, { justify: items.length >= 10 ? 'space-between' : 'flex-end', pl: "base", my: "base", align: "center", gap: "base", children: [items.length >= 10 && (_jsx(SearchInput, { value: searchValue, onChange: handleChange })), _jsx(LeftButtonAnimated, { onClick: handleAddItem, label: t('addHomeItem.btnLabel'), disabled: disabled, id: "addingItems" })] }), _jsxs(Box, { pb: "10", px: "base", children: [isItemsEmpty && _jsx(AddItemCard, { disabled: itemsDisabled, onClick: handleAddItem }), !isItemsEmpty && (_jsx(Wrap, { spacing: "base", children: filteredResults.map(({ _id, title, report, images, receipt, metadata, type, subType, room, }) => {
25
+ return (_jsx(TileTooltip, { label: title, children: _jsxs(Box, { backgroundColor: "lightBlue.1", boxShadow: "base", w: "100%", children: [_jsx(GroupCardHeader, { menuItems: menuItems, title: title, totalAmount: totalAmountFormatted }), _jsxs(Flex, { justify: items.length >= 10 ? 'space-between' : 'flex-end', pl: "base", my: "base", align: "center", gap: "base", children: [items.length >= 10 && (_jsx(SearchInput, { value: searchValue, onChange: handleChange })), _jsx(LeftButtonAnimated, { onClick: handleAddItem, label: t('addHomeItem.btnLabel'), disabled: disabled, id: "addingItems" })] }), _jsxs(Box, { pb: "10", px: "base", children: [isItemsEmpty && _jsx(AddItemCard, { disabled: itemsDisabled, onClick: handleAddItem }), !isItemsEmpty && (_jsx(Wrap, { spacing: "base", children: filteredResults.map(({ _id, title, report, images, receipt, metadata, type, subType, room, defaultImage }) => {
26
26
  var _a, _b, _c, _d;
27
27
  const reportData = {
28
28
  _id,
@@ -35,8 +35,8 @@ export const GroupCard = (_a) => {
35
35
  const brand = receipt
36
36
  ? ''
37
37
  : ((_a = report === null || report === void 0 ? void 0 : report.find((doc) => { var _a; return (_a = doc === null || doc === void 0 ? void 0 : doc.name) === null || _a === void 0 ? void 0 : _a.includes('Brand'); })) === null || _a === void 0 ? void 0 : _a.value) || '';
38
- const hasImage = images.length > 0;
39
- const imageUrl = `${storageUrl}/${(_b = images[0]) === null || _b === void 0 ? void 0 : _b.bucketName}/${(_c = images[0]) === null || _c === void 0 ? void 0 : _c.fileName}.${(_d = images[0]) === null || _d === void 0 ? void 0 : _d.extension}`;
38
+ const hasImage = images.length > 0 || defaultImage;
39
+ const imageUrl = `${storageUrl}/${(_b = images[0]) === null || _b === void 0 ? void 0 : _b.bucketName}/${(_c = images[0]) === null || _c === void 0 ? void 0 : _c.fileName}.${(_d = images[0]) === null || _d === void 0 ? void 0 : _d.extension}` || defaultImage;
40
40
  const storeImage = (metadata === null || metadata === void 0 ? void 0 : metadata.origin)
41
41
  ? getReceiptOrigin(metadata === null || metadata === void 0 ? void 0 : metadata.origin)
42
42
  : '';
@@ -95,14 +95,15 @@ export const PaintItems = [
95
95
  },
96
96
  needsReview: false,
97
97
  reviewed: false,
98
+ defaultImage: "https://storage.googleapis.com/homefile-images/range.png",
98
99
  images: [
99
- {
100
- bucketName: 'homefile-images',
101
- description: '',
102
- extension: 'jpeg',
103
- fileName: 'test-consult.jpeg-db224d',
104
- _id: '62aa4c6db225dd3957d09b24',
105
- },
100
+ // {
101
+ // bucketName: 'homefile-images',
102
+ // description: '',
103
+ // extension: 'jpeg',
104
+ // fileName: 'test-consult.jpeg-db224d',
105
+ // _id: '62aa4c6db225dd3957d09b24',
106
+ // },
106
107
  ],
107
108
  status: 'completed',
108
109
  deleted: false,
@@ -69,6 +69,7 @@ export interface ReportsI {
69
69
  updatedAt: string;
70
70
  user: string;
71
71
  receipt?: string;
72
+ defaultImage?: string;
72
73
  }
73
74
  export interface MapFileI {
74
75
  files: FolderFileI[] | File[] | FileI[] | ReportsI[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.39.12",
3
+ "version": "2.39.13",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",