import React, { FC } from 'react' import useCustomer from '@framework/use-customer' import { Container, Text } from '@components/ui' import { Module } from '@agility/nextjs' interface Fields { heading: string, fullNameLabel: string, emailLabel: string, notLoggedInMessage: string } const ProfileModule:Module = ({ module: {fields}}) => { const { data } = useCustomer() return ( {fields.heading} {data && (
{fields.fullNameLabel} {data.firstName} {data.lastName}
{fields.emailLabel} {data.email}
)} { !data && {fields.notLoggedInMessage} }
) } export default ProfileModule