chore: create

This commit is contained in:
Pablo Lara committed 2024-08-21 14:33:53 +02:00
1 parent 4b18397e69
commit 063de00e45
7 files changed
+54 -376

No files matched your search

+20
View File
@@ -0,0 +1,20 @@
"use client";
import { Button, CircularProgress } from "@nextui-org/react";
import React from "react";
import { useFormStatus } from "react-dom";
export const AuthButton = ({ type }: { type: string }) => {
const { pending } = useFormStatus();
return (
<Button color="primary" type="submit" aria-disabled={pending}>
{pending ? (
<CircularProgress aria-label="Loading..." />
) : type === "sign-in" ? (
"Log In"
) : (
"Sign Up"
)}
</Button>
);
};
+2 -3
View File
@@ -9,6 +9,7 @@ import { authenticate } from "@/actions";
import { ProwlerExtended } from "../icons";
import { ThemeSwitch } from "../ThemeSwitch";
import { AuthButton } from "./AuthButton";
export const AuthForm = ({ type }: { type: string }) => {
const [isVisible, setIsVisible] = useState(false);
@@ -89,9 +90,7 @@ export const AuthForm = ({ type }: { type: string }) => {
Forgot password?
</Link>
</div>
<Button color="primary" type="submit">
{type === "sign-in" ? "Log In" : "Sign Up"}
</Button>
<AuthButton type={type} />
</form>
{type === "sign-in" && (
<>
+1
View File
@@ -1 +1,2 @@
export * from "./AuthButton";
export * from "./AuthForm";
+2 -2
View File
@@ -1,6 +1,6 @@
"use client";
import { Button } from "@nextui-org/react";
import { Button, CircularProgress } from "@nextui-org/react";
import React from "react";
import { useFormStatus } from "react-dom";
@@ -8,7 +8,7 @@ export const ButtonAddProvider = () => {
const { pending } = useFormStatus();
return (
<Button type="submit" area-disabled={pending}>
{pending ? "Adding..." : "Add provider"}
{pending ? <CircularProgress aria-label="Loading..." /> : "Add provider"}
</Button>
);
};