import React from 'react' import { Alert, AlertButton, AlertOptions, Pressable, StyleSheet, Text, View } from 'react-native' import { useTheme } from '@utils/styles/ThemeManager' import { StyleConstants } from '@utils/styles/constants' export interface Props { text: string destructive?: boolean alertOption?: { title: string message?: string | undefined buttons?: AlertButton[] | undefined options?: AlertOptions | undefined } } const Core: React.FC = ({ text, destructive = false }) => { const { theme } = useTheme() return ( {text} ) } const MenuButton: React.FC = ({ ...props }) => { const { theme } = useTheme() return ( props.alertOption && Alert.alert( props.alertOption.title, props.alertOption.message, props.alertOption.buttons, props.alertOption.options ) } > ) } const styles = StyleSheet.create({ base: { height: 50, borderBottomWidth: 1 }, core: { flex: 1, flexDirection: 'row', justifyContent: 'center', alignItems: 'center', paddingLeft: StyleConstants.Spacing.Global.PagePadding, paddingRight: StyleConstants.Spacing.Global.PagePadding } }) export default MenuButton