import { Content } from "../../components/Content.tsx";
import { FabricVersions } from "../../islands/fabricVersions.tsx";
import { initFabric } from "../../util/initFabric.ts";

export default function FabricSetup() {
  try {
    const vers = Deno.readDirSync("./fabric/versions");
    if (Array.from(vers).length !== 3) throw "";
  } catch {
    initFabric();
  }

  return (
    <div class="container p-8">
      <Content>
        <h2 class="font-pixel text-2xl">Fabric Setup</h2>
        <p>Select the game version you wish to create a server for. If you know you need a different loader and installer version, you can change it here.</p>
        <FabricVersions />
      </Content>
    </div>
  );
}
