feat: add basic webui

This commit is contained in:
2024-12-30 06:39:09 +08:00
parent 608a7fb9c6
commit a4c549e7c3
462 changed files with 35900 additions and 2491 deletions

View File

@@ -0,0 +1,33 @@
'use client';
import { useState } from 'react';
import { signIn } from '../client';
export const SignIn = () => {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
return (
<form
onSubmit={async (e) => {
e.preventDefault();
await signIn.email({
email,
password,
});
}}
>
<input
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
/>
<input
type="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
/>
<button type="submit">Sign in</button>
</form>
);
};

View File

@@ -0,0 +1,40 @@
'use client';
import { useState } from 'react';
import { signUp } from '../client';
export const SignUp = () => {
const [email, setEmail] = useState('');
const [password, setPassword] = useState('');
const [name, setName] = useState('');
return (
<form
onSubmit={async (e) => {
e.preventDefault();
await signUp.email({
email,
password,
name,
});
}}
>
<input
type="email"
value={email}
onChange={(e) => setEmail(e.target.value)}
/>
<input
type="password"
value={password}
onChange={(e) => setPassword(e.target.value)}
/>
<input
type="text"
value={name}
onChange={(e) => setName(e.target.value)}
/>
<button type="submit">Sign up</button>
</form>
);
};