import {View, Text, SafeAreaView, ScrollView, Image, TouchableOpacity, ImageSourcePropType, Alert} from "react-native";
import React from "react";
import icons from "@/constants/icons"
import images from "@/constants/images";
import {settings} from "@/constants/data";
import {useGlobalContext} from "@/lib/globalProvider";
import {logOut} from "@/lib/appwrite";
import {parseJson} from "ajv/dist/runtime/parseJson";
import message = parseJson.message;
interface SettingsItemsProps{
icon: ImageSourcePropType,
title: string,
onPress?: () => void,
textStyle?: string,
showArrow?: boolean,
}
const SettingsItems = ({icon, title, onPress, textStyle, showArrow = true } : SettingsItemsProps) => (
{title}
{showArrow && }
)
const Profile = () => {
const {user, refetch} = useGlobalContext();
const handleLogout = async () => {
const result = await logOut();
if(result) {
Alert.alert('logged out')
refetch();
}
};
return (
Profile
{ user?.name}
{settings.slice(2).map((item, index ) => (
) )}
);
};
export default Profile;