mirror of
https://github.com/Portabase/portabase.git
synced 2026-07-14 11:16:13 +02:00
refactoring some files.
This commit is contained in:
+7
-3
@@ -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>
|
||||
)
|
||||
|
||||
}
|
||||
+2
-1
@@ -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 = {
|
||||
Reference in New Issue
Block a user