@@ -2,16 +2,28 @@ import Link from 'next/link';
2
2
3
3
import { trimmedStringToLength } from '@/utils/functions/functions' ;
4
4
5
+ interface ISearchResultProps {
6
+ hit : {
7
+ product_image : string ;
8
+ product_name : string ;
9
+ regular_price : string ;
10
+ sale_price : string ;
11
+ on_sale : boolean ;
12
+ short_description : string ;
13
+ objectID : number ;
14
+ } ;
15
+ }
16
+
5
17
/**
6
18
* Displays search results from Algolia
7
- * @param {Object } hit {
8
- * @param {String } product_image Product image from WooCommerce
9
- * @param {String } product_name Name of product
10
- * @param {Float } regular_price Price without discount
11
- * @param {Float } sale_price Price when on sale
12
- * @param {Boolean } on_sale Is the product on sale? True or false
13
- * @param {String } short_description Short description of product
14
- * @param {Integer } objectID ID of product
19
+ * @param {object } hit {
20
+ * @param {string } product_image Product image from WooCommerce
21
+ * @param {string } product_name Name of product
22
+ * @param {string } regular_price Price without discount
23
+ * @param {string } sale_price Price when on sale
24
+ * @param {boolean } on_sale Is the product on sale? True or false
25
+ * @param {string } short_description Short description of product
26
+ * @param {number } objectID ID of product
15
27
}
16
28
*/
17
29
const SearchResults = ( {
@@ -24,7 +36,7 @@ const SearchResults = ({
24
36
short_description,
25
37
objectID,
26
38
} ,
27
- } : any ) => {
39
+ } : ISearchResultProps ) => {
28
40
// Replace empty spaces with dash (-)
29
41
const trimmedProductName = product_name . replace ( / / g, '-' ) ;
30
42
0 commit comments