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 (
impl...
); }