import React from 'react'
import { Image, Text, View } from 'react-native'
import {
constShadow,
getContainerStyles,
getDescriptionStyle,
getLeftAccentStyle,
getTitleStyle,
} from '../stylesUtils'
import { styles } from '../styles'
import type { MergedNotificationStyleConfig, NotificationOwnProps } from '../types'
import { TouchableOpacity, TouchableWithoutFeedback } from 'react-native-gesture-handler'
import { useNotificationController } from '../../hooks/useNotificationController'
export const NotificationBase = (props: NotificationOwnProps & MergedNotificationStyleConfig) => {
const containerStyles = getContainerStyles({ ...props })
const titleStyle = getTitleStyle({ ...props })
const descriptionStyle = getDescriptionStyle({ ...props })
const accentStyle = getLeftAccentStyle(props.accentColor)
const rightIconSource =
props.theme === 'regular'
? require('../../assets/images/close-regularMode.png')
: require('../../assets/images/close-darkMode.png')
const { remove } = useNotificationController()
const renderLeftIcon = () =>
typeof props.leftIconSource === 'object' ? (
props.leftIconSource
) : (
)
const renderRightIcon = () =>
!props.hideCloseButton && (
{
remove()
}}>
)
const renderTitle = () => {props.title}
const renderDescription = () =>
!!props.description && (
{props.description}
)
return (
props.onPress?.()}>
{props.borderType === 'accent' && }
{props.defaultIconType !== 'no-icon' && renderLeftIcon()}
{renderTitle()}
{renderDescription()}
{renderRightIcon()}
)
}