// Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. // SPDX-License-Identifier: MIT-0 import React, { useState } from 'react'; import { FormField, Input, Button, Heading, } from 'amazon-chime-sdk-component-library-react'; import './LoginWithCognito.css'; const LoginWithCognito = (props) => { const [userName, setUsername] = useState(''); const [password, setPassword] = useState(''); const { login, register } = props; const onRegister = (e) => { e.preventDefault(); register(userName, password, ''); }; const onLogin = (e) => { e.preventDefault(); login(userName, password); }; const onUserName = (e) => { setUsername(e.target.value); }; const onPassword = (e) => { setPassword(e.target.value); }; return (