import { createQuery } from "@tanstack/solid-query"; import { activeURI } from "../App"; import { callApi } from "../api"; import { Accessor, Show } from "solid-js"; import { useNavigate } from "@solidjs/router"; interface HeaderProps { clan_dir: Accessor; } export const Header = (props: HeaderProps) => { const { clan_dir } = props; const navigate = useNavigate(); const query = createQuery(() => ({ queryKey: [clan_dir(), "meta"], queryFn: async () => { const curr = clan_dir(); if (curr) { const result = await callApi("show_clan_meta", { uri: curr }); if (result.status === "error") throw new Error("Failed to fetch data"); return result.data; } }, })); return ( ); };