Files
Crm-Client-Frontend/components/Forms/AuthenticationForm.tsx
2025-10-18 01:46:46 +03:00

46 lines
1.1 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

import {
Anchor,
Button,
Checkbox,
Divider,
Group,
Paper,
PaperProps,
PasswordInput,
Stack,
Text,
TextInput,
} from '@mantine/core';
import { useForm } from '@mantine/form';
import { upperFirst, useToggle } from '@mantine/hooks';
import { LogidexButton } from '@/components/Forms/LogidexButton';
export function AuthenticationForm(props: PaperProps) {
const [type, toggle] = useToggle(['login', 'register']);
const form = useForm({
initialValues: {
email: '',
name: '',
password: '',
terms: true,
},
validate: {
email: (val) => (/^\S+@\S+$/.test(val) ? null : 'Invalid email'),
password: (val) => (val.length <= 6 ? 'Password should include at least 6 characters' : null),
},
});
return (
<Paper radius="md" p="lg" withBorder {...props}>
<Text size="lg" fw={500} ta="center">
Добро пожаловать в Logidex
</Text>
<Group grow mb="md" mt="md">
<LogidexButton radius="xl">Войти с помощью LogidexID</LogidexButton>
</Group>
</Paper>
);
}