import { Fragment } from 'react' import { ItemKey } from './components/ItemKey' import { Box, Stack, Typography } from '@mui/material' import { AddAccountButton, GetStartedButton, LearnMoreButton } from './styled' import { useAppSelector } from '@/store/hooks/redux' import { selectKeys } from '@/store' import { SectionTitle } from '@/shared/SectionTitle/SectionTitle' import { useModalSearchParams } from '@/hooks/useModalSearchParams' import { MODAL_PARAMS_KEYS } from '@/types/modal' import { DOMAIN } from '@/utils/consts' const HomePage = () => { const keys = useAppSelector(selectKeys) const isNoKeys = !keys || keys.length === 0 const { handleOpen } = useModalSearchParams() const handleClickAddAccount = () => handleOpen(MODAL_PARAMS_KEYS.INITIAL) const handleLearnMore = () => { // @ts-ignore window.open(`https://${DOMAIN}`, '_blank').focus() } return ( {isNoKeys ? 'Welcome' : 'Accounts:'} {isNoKeys && ( <> Nsec.app is a novel key storage app for Nostr. Get started Your keys are stored in your browser and can be used in many Nostr apps without the need for a browser extension. Learn more )} {!isNoKeys && ( {keys.map((key) => ( ))} Add account )} ) } export default HomePage