@homefile/components-v2 2.24.24 → 2.24.26

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.
@@ -17,10 +17,6 @@ export const ReceiptDetails = ({ name, cashier = '', itemQuantity, paymentMethod
17
17
  label: leftLabels[1],
18
18
  value: store,
19
19
  },
20
- {
21
- label: leftLabels[2],
22
- value: storePhone,
23
- },
24
20
  {
25
21
  label: leftLabels[3],
26
22
  value: cashier,
@@ -1,16 +1,17 @@
1
1
  import { HomeDepot, Lowes, Walmart, DefaultReceipt } from '../../assets/images';
2
2
  export const receiptOrigins = {
3
- homeDepot: HomeDepot,
4
- HomeDepot: HomeDepot,
3
+ homedepot: HomeDepot,
5
4
  lowes: Lowes,
6
- Lowes: Lowes,
7
5
  walmart: Walmart,
8
- Walmart: Walmart,
9
6
  "": DefaultReceipt
10
7
  };
8
+ function normalize(input) {
9
+ return input.trim().toLowerCase().replace(/['\s]+/g, '');
10
+ }
11
11
  export const getReceiptOrigin = (key) => {
12
12
  var _a;
13
- return (_a = receiptOrigins[key]) !== null && _a !== void 0 ? _a : DefaultReceipt;
13
+ const normalizedKey = normalize(key);
14
+ return (_a = receiptOrigins[normalizedKey]) !== null && _a !== void 0 ? _a : DefaultReceipt;
14
15
  };
15
16
  export const receipts = [
16
17
  {
@@ -63,7 +63,6 @@ const receiptSchemaMock = {
63
63
  purchaseDate: '2024-06-18T00:00:00.000Z',
64
64
  tax: '3.17',
65
65
  store: '8418',
66
- storePhone: '512.258.7914',
67
66
  total: '41.65',
68
67
  items: [
69
68
  {
@@ -13,6 +13,7 @@ export declare const ReceiptDetailsComponent: {
13
13
  store: string;
14
14
  storePhone: string;
15
15
  name: string;
16
+ origin: string;
16
17
  total: string;
17
18
  onEdit: import("@storybook/addon-actions").HandlerFunction;
18
19
  onFileClick: () => void;
@@ -18,6 +18,7 @@ ReceiptDetailsComponent.args = {
18
18
  store: '8418',
19
19
  storePhone: '1234567890',
20
20
  name: 'Home Depot',
21
+ origin: "Home Depot",
21
22
  total: '41.65',
22
23
  onEdit: action('onEdit'),
23
24
  onFileClick: () => { }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@homefile/components-v2",
3
- "version": "2.24.24",
3
+ "version": "2.24.26",
4
4
  "author": "Homefile",
5
5
  "license": "UNLICENSED",
6
6
  "typings": "dist/index.d.ts",
@@ -31,10 +31,6 @@ export const ReceiptDetails = ({
31
31
  label: leftLabels[1],
32
32
  value: store,
33
33
  },
34
- {
35
- label: leftLabels[2],
36
- value: storePhone,
37
- },
38
34
  {
39
35
  label: leftLabels[3],
40
36
  value: cashier,
@@ -2,17 +2,19 @@ import { ReceiptCardItemI } from '@/interfaces'
2
2
  import { HomeDepot, Lowes, Walmart, DefaultReceipt } from '@/assets/images'
3
3
 
4
4
  export const receiptOrigins: Record<string, string> = {
5
- homeDepot: HomeDepot,
6
- HomeDepot: HomeDepot,
5
+ homedepot: HomeDepot,
7
6
  lowes: Lowes,
8
- Lowes: Lowes,
9
7
  walmart: Walmart,
10
- Walmart: Walmart,
11
8
  "" : DefaultReceipt
12
9
  }
13
10
 
11
+ function normalize(input: string) {
12
+ return input.trim().toLowerCase().replace(/['\s]+/g, '');
13
+ }
14
+
14
15
  export const getReceiptOrigin = (key: string): string => {
15
- return receiptOrigins[key] ?? DefaultReceipt;
16
+ const normalizedKey = normalize(key)
17
+ return receiptOrigins[normalizedKey] ?? DefaultReceipt;
16
18
  };
17
19
 
18
20
  export const receipts: ReceiptCardItemI[] = [
@@ -161,7 +161,6 @@ const receiptSchemaMock = {
161
161
  purchaseDate: '2024-06-18T00:00:00.000Z',
162
162
  tax: '3.17',
163
163
  store: '8418',
164
- storePhone: '512.258.7914',
165
164
  total: '41.65',
166
165
  items: [
167
166
  {
@@ -26,6 +26,7 @@ ReceiptDetailsComponent.args = {
26
26
  store: '8418',
27
27
  storePhone: '1234567890',
28
28
  name: 'Home Depot',
29
+ origin: "Home Depot",
29
30
  total: '41.65',
30
31
  onEdit: action('onEdit'),
31
32
  onFileClick: () => {}