refactor(header): integrate search and theme functions via Alpine

- header.ts now imports and re-exports functions from search.ts
  and theme.ts for use in the header template
- Functions available via x-data=header:
  - initializeSearch
  - initializeTheme
  - changeTheme
  - changeWoodPaneling
  - loadWoodPaneling
  - updateWoodPanelingIndicators
- header.templ x-init calls these functions directly
- Enables proper SSR-first pattern with x-init for setup only
This commit is contained in:
2026-03-13 12:51:21 -04:00
parent 2075077bb7
commit 3e292f18c8
2 changed files with 15 additions and 1 deletions
+14
View File
@@ -1,6 +1,14 @@
// Header functionality
import { Alpine } from "./alpine";
import { initializeSearch } from "./search";
import {
initializeTheme,
changeTheme,
changeWoodPaneling,
loadWoodPaneling,
updateWoodPanelingIndicators,
} from "./theme";
const logout = (): void => {
localStorage.removeItem("token");
@@ -12,4 +20,10 @@ export { logout };
Alpine.data("header", () => ({
logout,
initializeSearch,
initializeTheme,
changeTheme,
changeWoodPaneling,
loadWoodPaneling,
updateWoodPanelingIndicators,
}));