aboutsummaryrefslogtreecommitdiffstats
path: root/packages/browser-extension/src/App.tsx
blob: 8a2c4920f28f23f722642aac2f91e81f819033df (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
import SavePage from "./SavePage";
import usePluginSettings from "./settings";
import { useNavigate } from "react-router-dom";

function App() {
  const navigate = useNavigate();
  const [settings, _1, _2, _3, isInit] = usePluginSettings();

  if (!isInit) {
    return <div className="p-4">Loading ... </div>;
  }

  if (!settings.apiKey || !settings.address) {
    navigate("/notconfigured");
    return;
  }

  return (
    <div className="flex flex-col space-y-2">
      <SavePage settings={settings} />
      <hr />
      <div className="flex justify-end">
        <button className="w-2/6" onClick={() => navigate("/options")}>
          Settings
        </button>
      </div>
    </div>
  );
}

export default App;