@homefile/components-v2 2.39.12 → 2.39.14
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,
|
|
@@ -36,11 +36,11 @@ export const GroupCard = (_a) => {
|
|
|
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
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}
|
|
39
|
+
const imageUrl = hasImage ? `${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
|
: '';
|
|
43
|
-
const existingImage = hasImage ? imageUrl : storeImage;
|
|
43
|
+
const existingImage = (hasImage || imageUrl !== undefined) ? imageUrl : storeImage;
|
|
44
44
|
const groupImage = GroupIcons[groupTitle] || Group;
|
|
45
45
|
const handleImage = (files) => {
|
|
46
46
|
if (files) {
|
|
@@ -95,6 +95,7 @@ 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
|
{
|
|
100
101
|
bucketName: 'homefile-images',
|
|
@@ -137,6 +138,7 @@ export const PaintItems = [
|
|
|
137
138
|
user: '62388ab2a1a4a98e69942bb5',
|
|
138
139
|
home: '62a20af1cc6d1000ef17c7d0',
|
|
139
140
|
title: 'Cabinets-Bottom',
|
|
141
|
+
defaultImage: "https://storage.googleapis.com/homefile-images/freezer.png",
|
|
140
142
|
report: [
|
|
141
143
|
{
|
|
142
144
|
id: faker.database.mongodbObjectId(),
|
|
@@ -261,6 +263,7 @@ export const PaintItems = [
|
|
|
261
263
|
user: '62b3c96892d0bad2cc64c327',
|
|
262
264
|
home: '62b3cc68061c02d53850ddb6',
|
|
263
265
|
title: 'Cabinets-inside',
|
|
266
|
+
defaultImage: "https://storage.googleapis.com/homefile-images/fridge.png",
|
|
264
267
|
description: '',
|
|
265
268
|
report: [
|
|
266
269
|
{
|
|
@@ -370,6 +373,7 @@ export const PaintItems = [
|
|
|
370
373
|
user: '62b3c96892d0bad2cc64c327',
|
|
371
374
|
home: '62b3cc68061c02d53850ddb6',
|
|
372
375
|
title: 'Cabinets-inside',
|
|
376
|
+
defaultImage: "https://storage.googleapis.com/homefile-images/microwave.png",
|
|
373
377
|
description: '',
|
|
374
378
|
report: [
|
|
375
379
|
{
|
|
@@ -476,6 +480,7 @@ export const PaintItems = [
|
|
|
476
480
|
user: '62b3c96892d0bad2cc64c327',
|
|
477
481
|
home: '62b3cc68061c02d53850ddb6',
|
|
478
482
|
title: 'Cabinets-inside',
|
|
483
|
+
defaultImage: "https://storage.googleapis.com/homefile-images/cook-top.png",
|
|
479
484
|
description: '',
|
|
480
485
|
report: [
|
|
481
486
|
{
|
|
@@ -581,6 +586,7 @@ export const PaintItems = [
|
|
|
581
586
|
_id: '62b49071061c02d53850dec6',
|
|
582
587
|
user: '62b3c96892d0bad2cc64c327',
|
|
583
588
|
home: '62b3cc68061c02d53850ddb6',
|
|
589
|
+
defaultImage: "https://storage.googleapis.com/homefile-images/tank-waterhtr.png",
|
|
584
590
|
title: 'Cabinets-inside',
|
|
585
591
|
description: '',
|
|
586
592
|
report: [
|
|
@@ -688,6 +694,7 @@ export const PaintItems = [
|
|
|
688
694
|
user: '62b3c96892d0bad2cc64c327',
|
|
689
695
|
home: '62b3cc68061c02d53850ddb6',
|
|
690
696
|
title: 'Cabinets-inside',
|
|
697
|
+
defaultImage: "https://storage.googleapis.com/homefile-images/hood.png",
|
|
691
698
|
description: '',
|
|
692
699
|
report: [
|
|
693
700
|
{
|
|
@@ -793,6 +800,7 @@ export const PaintItems = [
|
|
|
793
800
|
_id: '62b49071061c02d53850dec8',
|
|
794
801
|
user: '62b3c96892d0bad2cc64c327',
|
|
795
802
|
home: '62b3cc68061c02d53850ddb6',
|
|
803
|
+
defaultImage: "https://storage.googleapis.com/homefile-images/washer.png",
|
|
796
804
|
title: 'Cabinets-inside',
|
|
797
805
|
description: '',
|
|
798
806
|
report: [
|