mirror of
https://github.com/Hestia-Homes/assessment-model.git
synced 2026-06-30 12:55:02 +00:00
commit
580bcd6861
5 changed files with 20 additions and 11 deletions
|
|
@ -6,6 +6,7 @@ import { AuthOptions } from "@/app/api/auth/[...nextauth]/route";
|
|||
import { getServerSession } from "next-auth/next";
|
||||
import { cache } from "react";
|
||||
import { Inter } from "next/font/google";
|
||||
import { Toaster } from "@/app/shadcn_components/ui/toaster";
|
||||
|
||||
// If loading a variable font, you don't need to specify the font weight
|
||||
const inter = Inter({
|
||||
|
|
@ -51,6 +52,7 @@ export default async function RootLayout({
|
|||
<ReactQueryProvider>
|
||||
<Nav userImage={userImage} />
|
||||
<main className="flex-grow">{children}</main>
|
||||
<Toaster />
|
||||
<Footer />
|
||||
</ReactQueryProvider>
|
||||
</Provider>
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
"use client";
|
||||
|
||||
import { Dialog, Transition, Menu } from "@headlessui/react";
|
||||
import { useState, Fragment, useMemo, useRef } from "react";
|
||||
import { Fragment, useMemo } from "react";
|
||||
import { Input } from "@/app/shadcn_components/ui/input";
|
||||
import { Button } from "@/app/shadcn_components/ui/button";
|
||||
import { Float } from "@headlessui-float/react";
|
||||
import { ChevronDownIcon } from "@heroicons/react/20/solid";
|
||||
import { useMutation } from "@tanstack/react-query";
|
||||
import { useSession } from "next-auth/react";
|
||||
import { Form, useForm, FormProvider } from "react-hook-form";
|
||||
import { useForm, FormProvider } from "react-hook-form";
|
||||
import { zodResolver } from "@hookform/resolvers/zod";
|
||||
import * as z from "zod";
|
||||
import {
|
||||
|
|
@ -18,8 +18,7 @@ import {
|
|||
FormControl,
|
||||
FormMessage,
|
||||
} from "@/app/shadcn_components/ui/form";
|
||||
import { Toast } from "@/app/shadcn_components/ui/toast";
|
||||
import { FileKey } from "lucide-react";
|
||||
import { useToast } from "@/app/hooks/use-toast";
|
||||
|
||||
type Option = {
|
||||
label: string;
|
||||
|
|
@ -417,12 +416,18 @@ export default function RemoteAssessmentModal({
|
|||
},
|
||||
});
|
||||
|
||||
// const [toastState, setToastState] = useState<any>([]);
|
||||
const { toast } = useToast();
|
||||
|
||||
const onSubmit = async (data: FormValues) => {
|
||||
try {
|
||||
await handleSubmit(data);
|
||||
form.reset();
|
||||
setIsOpen(false);
|
||||
toast({
|
||||
title: "The Remote Assesment has been sent",
|
||||
description: "",
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Error submitting form:", error);
|
||||
}
|
||||
|
|
@ -631,11 +636,13 @@ export default function RemoteAssessmentModal({
|
|||
<Button
|
||||
type="button"
|
||||
variant="outline"
|
||||
onClick={() => setIsOpen(false)}
|
||||
>
|
||||
onClick={() => { setIsOpen(false); }}>
|
||||
Cancel
|
||||
</Button>
|
||||
<Button type="submit" disabled={presignedUrlIsLoading}>
|
||||
<Button
|
||||
type="submit"
|
||||
disabled={presignedUrlIsLoading}
|
||||
>
|
||||
{presignedUrlIsLoading ? "Submitting..." : "Submit"}
|
||||
</Button>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -5,7 +5,7 @@ import * as ToastPrimitives from "@radix-ui/react-toast"
|
|||
import { cva, type VariantProps } from "class-variance-authority"
|
||||
import { X } from "lucide-react"
|
||||
|
||||
import { cn } from "s/lib/utils"
|
||||
import { cn } from "@/lib/utils"
|
||||
|
||||
const ToastProvider = ToastPrimitives.Provider
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
"use client"
|
||||
|
||||
import { useToast } from "src/app/shadcn_components/hooks/use-toast"
|
||||
import { useToast } from "@/app/hooks/use-toast"
|
||||
import {
|
||||
Toast,
|
||||
ToastClose,
|
||||
|
|
@ -8,7 +8,7 @@ import {
|
|||
ToastProvider,
|
||||
ToastTitle,
|
||||
ToastViewport,
|
||||
} from "src/app/shadcn_components/ui/toast"
|
||||
} from "@/app/shadcn_components/ui/toast"
|
||||
|
||||
export function Toaster() {
|
||||
const { toasts } = useToast()
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
import { type ClassValue, clsx } from "clsx"
|
||||
import { twMerge } from "tailwind-merge"
|
||||
|
||||
export function cn(...inputs: ClassValue[]) {
|
||||
export function cn (...inputs: ClassValue[]) {
|
||||
return twMerge(clsx(inputs))
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue