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 = {
+2 -13
View File
@@ -6,19 +6,8 @@ import {Check, ChevronDown} from "lucide-react"
import {cn} from "@/lib/utils"
import {Button} from "@/components/ui/button"
import {
Command,
CommandEmpty,
CommandGroup,
CommandInput,
CommandItem,
CommandList,
} from "@/components/ui/command"
import {
Popover,
PopoverContent,
PopoverTrigger,
} from "@/components/ui/popover"
import {Command, CommandEmpty, CommandGroup, CommandInput, CommandItem, CommandList} from "@/components/ui/command"
import {Popover, PopoverContent, PopoverTrigger} from "@/components/ui/popover"
import {FormControl} from "@/components/ui/form";
import {SidebarMenuButton} from "@/components/ui/sidebar";
import {Separator} from "@/components/ui/separator";