11import { BottomSheetModal } from '@gorhom/bottom-sheet' ;
22import { useTranslation } from '@ronas-it/react-native-common-modules/i18n' ;
33import { ReactElement , useRef } from 'react' ;
4+ import { Alert } from 'react-native' ;
45import { useLogout } from '@open-webui-react-native/mobile/shared/features/use-logout' ;
56import {
67 Avatar ,
@@ -36,6 +37,25 @@ export function ProfileMenuSheet({ onArchivedChatsPress, ...restProps }: Profile
3637 onArchivedChatsPress ( ) ;
3738 } ;
3839
40+ const handleDeleteAccountPress = ( ) : void => {
41+ ToastService . show ( translate ( 'TEXT_ACCOUNT_DELETION_REQUEST' ) ) ;
42+ } ;
43+
44+ const handleRequestDeleteAccountPress = async ( ) : Promise < void > => {
45+ await closeActionsSheet ( ) ;
46+ Alert . alert (
47+ translate ( 'TEXT_DELETE_ACCOUNT_TITLE' ) ,
48+ translate ( 'TEXT_DELETE_ACCOUNT_MESSAGE' ) ,
49+ [
50+ { text : translate ( 'BUTTON_DELETE_ACCOUNT' ) , style : 'destructive' , onPress : handleDeleteAccountPress } ,
51+ { text : translate ( 'BUTTON_DONT_DELETE' ) , style : 'cancel' } ,
52+ ] ,
53+ {
54+ userInterfaceStyle : 'dark' ,
55+ } ,
56+ ) ;
57+ } ;
58+
3959 const actions : Array < ActionSheetItemProps > = [
4060 {
4161 title : translate ( 'TEXT_ARCHIVED_CHATS' ) ,
@@ -44,6 +64,12 @@ export function ProfileMenuSheet({ onArchivedChatsPress, ...restProps }: Profile
4464 ? handleArchivedChatsPress
4565 : ToastService . showFeatureNotImplemented ,
4666 } ,
67+ {
68+ title : translate ( 'TEXT_DELETE_ACCOUNT' ) ,
69+ iconName : 'trashCan' ,
70+ onPress : handleRequestDeleteAccountPress ,
71+ isDanger : true ,
72+ } ,
4773 {
4874 title : translate ( 'TEXT_LOGOUT' ) ,
4975 iconName : 'logout' ,
0 commit comments