import { type Config } from "@/types/config";
import { useState, useEffect } from "react";

export const useConfig = (): Config => {
  const [config, setConfig] = useState<Config>({ name: ["", ""] });

  useEffect(() => {
    fetch("/config/config.json")
      .then((res) => res.json())
      .then(setConfig)
      .catch(console.error);
  }, []);

  return config;
};
