refactoring some files.

This commit is contained in:
killian-larcher
2024-12-16 20:01:30 +01:00
parent 31ee81c10f
commit 4f12a2b078
26 changed files with 160 additions and 70 deletions
@@ -1,4 +1,5 @@
"use client"
import {Button} from "@/components/ui/button";
import {useState} from "react";
import {Loader2} from "lucide-react";
@@ -15,15 +16,17 @@ export type VariantButton = {
export type ButtonWithConfirmProps = {
icon?: any,
text: string,
variant?: keyof VariantButton ,
variant?: keyof VariantButton,
className?: string,
onClick?: () => void,
isPending? : boolean
isPending?: boolean
};
export const ButtonWithConfirm = (props: ButtonWithConfirmProps) => {
const [isConfirming, setIsConfirming] = useState(false)
return(
return (
<Button
onClick={() => {
if (isConfirming) {
@@ -42,4 +45,5 @@ export const ButtonWithConfirm = (props: ButtonWithConfirmProps) => {
</>
</Button>
)
}
@@ -1,6 +1,7 @@
"use client"
import {Button} from "@/components/ui/button";
import {ButtonHTMLAttributes, useState} from "react";
import {ButtonHTMLAttributes} from "react";
import {Loader2} from "lucide-react";
export type VariantButton = {