// @flow import * as React from 'react'; import {StyleSheet} from "react-native"; import i18n from "i18n-js"; import {Avatar, Button, Card} from 'react-native-paper'; import {getFormattedEventTime, isDescriptionEmpty} from "../../utils/Planning"; import CustomHTML from "../Custom/CustomHTML"; type Props = { event: Object, clickAction: Function, } /** * Component used to display an event preview if an event is available */ class PreviewEventDashboardItem extends React.Component { render() { const props = this.props; const isEmpty = props.event === undefined ? true : isDescriptionEmpty(props.event['description']); if (props.event !== undefined && props.event !== null) { const hasImage = props.event['logo'] !== '' && props.event['logo'] !== null; const getImage = () => ; return ( {hasImage ? : } {!isEmpty ? : null} ); } else return null; } } const styles = StyleSheet.create({ card: { marginBottom: 10 }, content: { maxHeight: 150, overflow: 'hidden', }, actions: { marginLeft: 'auto', marginTop: 'auto', flexDirection: 'row' }, avatar: { backgroundColor: 'transparent' } }); export default PreviewEventDashboardItem;