astro-tractstack 2.0.0-rc.38 → 2.0.0-rc.39
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.
package/package.json
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { useState } from 'react';
|
|
1
|
+
import { useState, useEffect } from 'react';
|
|
2
2
|
import { MagnifyingGlassIcon } from '@heroicons/react/24/outline';
|
|
3
|
+
import { initSearch } from '@/utils/customHelpers';
|
|
3
4
|
import SearchModal from './SearchModal';
|
|
4
5
|
import type { FullContentMapItem } from '@/types/tractstack';
|
|
5
6
|
|
|
@@ -18,6 +19,10 @@ export default function SearchWrapper({ contentMap }: SearchWrapperProps) {
|
|
|
18
19
|
setIsSearchOpen(false);
|
|
19
20
|
};
|
|
20
21
|
|
|
22
|
+
useEffect(() => {
|
|
23
|
+
initSearch();
|
|
24
|
+
}, []);
|
|
25
|
+
|
|
21
26
|
return (
|
|
22
27
|
<>
|
|
23
28
|
<button
|
|
@@ -21,3 +21,9 @@ export function getResourceImage(
|
|
|
21
21
|
console.log(`please define getResourceImage`, id, slug, category);
|
|
22
22
|
return '/static.jpg';
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
// Initialize search data - override in custom implementation
|
|
26
|
+
export function initSearch(): void {
|
|
27
|
+
// Default implementation does nothing
|
|
28
|
+
// Override this function in your custom implementation to load search data
|
|
29
|
+
}
|