"use client";

import { BugReport } from "@mui/icons-material";
import { Box, Button, IconButton, Typography } from "@mui/material";
import { useRouter } from "next/router";
import { useEffect, useState } from "react";

export default function Testing() {
  const router = useRouter();

  const [configDir, setConfigDir] = useState<string>("");

  const initializeConfigDir = async () => {
    const { appConfigDir } = await import("@tauri-apps/api/path");
    setConfigDir(await appConfigDir());
  };

  useEffect(() => {
    initializeConfigDir();
  });

  return (
    <Box>
      <IconButton
        onClick={() => {
          router.push("/");
        }}
      >
        <BugReport />
      </IconButton>
      <Button
        onClick={() => {
          console.log(configDir);
        }}
      >
        Button
      </Button>
      <Typography>{configDir}</Typography>
    </Box>
  );
}
