From 761b4401fcb2a3df55c9ef30f5d8be9f8cdb294d Mon Sep 17 00:00:00 2001 From: charles-gauthereau Date: Sat, 23 Nov 2024 17:20:24 +0100 Subject: [PATCH] Delete user from settings. --- app/(customer)/dashboard/profile/page.tsx | 2 +- .../ButtonWithLoading/ButtonWithLoading.tsx | 16 ++++++-- .../ButtonDeleteAccount.tsx | 6 ++- .../delete-account.action.ts | 11 ++--- .../SettingsEmailTab/SettingsEmailTab.tsx | 1 + .../SettingsUsersTab/columns-users.tsx | 40 ++++++++++++++++++- 6 files changed, 64 insertions(+), 12 deletions(-) diff --git a/app/(customer)/dashboard/profile/page.tsx b/app/(customer)/dashboard/profile/page.tsx index 257efdd7..e9846af0 100644 --- a/app/(customer)/dashboard/profile/page.tsx +++ b/app/(customer)/dashboard/profile/page.tsx @@ -29,7 +29,7 @@ export default async function RoutePage(props: PageParams<{}>) { {userInfo.authMethod} - + diff --git a/src/components/wrappers/Button/ButtonWithLoading/ButtonWithLoading.tsx b/src/components/wrappers/Button/ButtonWithLoading/ButtonWithLoading.tsx index 539b1057..61c9de48 100644 --- a/src/components/wrappers/Button/ButtonWithLoading/ButtonWithLoading.tsx +++ b/src/components/wrappers/Button/ButtonWithLoading/ButtonWithLoading.tsx @@ -11,14 +11,21 @@ export type VariantButton = { link: string destructive: string } +export type sizeButton = { + default :string, + icon: string + sm: string + lg: string +} export type ButtonWithConfirmProps = { icon?: any, text: string, - variant?: keyof VariantButton , + variant?: keyof VariantButton, className?: string, onClick: () => void, - isPending? : boolean + isPending?: boolean + size: keyof sizeButton }; export const ButtonWithLoading = ({ @@ -28,9 +35,10 @@ export const ButtonWithLoading = ({ className, onClick, isPending, + size, ...props // catch all remaining props }: ButtonWithConfirmProps & ButtonHTMLAttributes) => { - return( + return (