import {createFileRoute} from "@tanstack/react-router";
import {useServerFn} from "@tanstack/react-start";
import {toast} from "sonner";
import {Button} from "@/components/ui/button";
import {clientEnv} from "@/env.client";
import {templateGroups} from "@/weddings/definitions/templateGroups";
import {devAction, type DevAction, devActionSchema} from "@/actions/devAction";

export const Route = createFileRoute("/dev/")({
  component: DevAdmin,
});

export function DevAdmin() {
  const callDevAction = useServerFn(devAction);

  const executeAction = async (args: DevAction) => {
    try {
      const r = await callDevAction({
        data: args,
      });
      toast(`Executed ${args.action}`);
      return r as unknown;
    } catch (e) {
      console.error(e);
      toast.error(`Error in ${args.action}`);
    }
  };

  return (
      <div className="container mx-10 my-5 flex flex-col gap-5">
        impl...
      </div>
  );
}
