refactor(ui): ♻️ update demo profil page

This commit is contained in:
Julien Oculi 2024-06-19 10:26:48 +02:00
parent db07adbe22
commit 91eefc520f

View file

@ -1,8 +1,31 @@
export default function Profil() {
import { Button } from 'univoq'
import LoginForm from '../../islands/LoginForm.tsx'
import PassKeyRegister from '../../islands/PassKeyRegister.tsx'
import type { SessionPageProps } from '../../src/session/mod.ts'
import type { User } from '@cohabit/ressources_manager/mod.ts'
export default function Profil({ state }: SessionPageProps) {
const user = state.session?.get<User>('user')
if (user) {
return (
<>
<h1>Profil</h1>
<section></section>
<h1>Mon compte</h1>
<section>
<pre>{ JSON.stringify(user, null, 2) }</pre>
</section>
<div>
<PassKeyRegister />
<Button label='Disconnect' variant='primary'>Disconnect</Button>
</div>
</>
)
}
return (
<>
<h1>Accéder à mon compte</h1>
<LoginForm />
</>
)
}