import Head from 'next/head'; import type { Session } from 'next-auth'; import { useSession } from 'next-auth/react'; import { useState } from 'react'; import { Button, HorizontalDivider, TextInput, useToast } from '@tih/ui'; import Container from '~/components/shared/Container'; import { trpc } from '~/utils/trpc'; function SettingsForm({ session, }: Readonly<{ session: Session; }>) { const { showToast } = useToast(); const updateProfileMutation = trpc.useMutation( ['user.settings.profile.update'], { onError: () => { showToast({ subtitle: 'Please check that you are logged in.', title: 'Failed to update profile', variant: 'failure', }); }, onSuccess: () => { showToast({ title: 'Updated profile!', variant: 'success', }); }, }, ); const [name, setName] = useState(session?.user?.name); const [email, setEmail] = useState(session?.user?.email); return (
This information will be displayed publicly so be careful what you share.
You are not signed in
; } return ( <>