import { Box, BoxProps, Button, FormGroup, H2, H5, Illustration, Input, Label, MadeWithLove, MessageBox, Text, } from '@adminjs/design-system' import { styled } from '@adminjs/design-system/styled-components' import React from 'react' import { useSelector } from 'react-redux' import { allowOverride } from '../../hoc/allow-override.js' import { useTranslation } from '../../hooks/index.js' import { ReduxState } from '../../store/store.js' import { LoginTemplateAttributes } from '../../login-template.js' const Wrapper = styled(Box)` align-items: center; justify-content: center; flex-direction: column; height: 100%; ` const StyledLogo = styled.img` max-width: 200px; margin: ${({ theme }) => theme.space.md} 0; ` const IllustrationsWrapper = styled(Box)` display: flex; flex-wrap: wrap; align-items: center; justify-content: center; & svg [stroke='#3B3552'] { stroke: rgba(255, 255, 255, 0.5); } & svg [fill='#3040D6'] { fill: rgba(255, 255, 255, 1); } ` export type LoginProps = { message?: string action: string } export const Login: React.FC = () => { const props = (window as any).__APP_STATE__ as LoginTemplateAttributes const { action, errorMessage: message } = props const { translateComponent, translateMessage } = useTranslation() const branding = useSelector((state: ReduxState) => state.branding) return (

{translateComponent('Login.welcomeHeader')}

{translateComponent('Login.welcomeMessage')}
{branding.logo ? ( ) : ( branding.companyName )}
{message && ( 1 ? message : translateMessage(message)} variant="danger" /> )}
{branding.withMadeWithLove ? ( ) : null}
) } export default allowOverride(Login, 'Login')