vat_wms/resources/js/Pages/Profile/Show.tsx
2025-05-13 12:32:55 +02:00

78 lines
2.3 KiB
TypeScript

import React from 'react';
import DeleteUserForm from '@/Pages/Profile/Partials/DeleteUserForm';
import LogoutOtherBrowserSessions from '@/Pages/Profile/Partials/LogoutOtherBrowserSessionsForm';
import TwoFactorAuthenticationForm from '@/Pages/Profile/Partials/TwoFactorAuthenticationForm';
import UpdatePasswordForm from '@/Pages/Profile/Partials/UpdatePasswordForm';
import UpdateProfileInformationForm from '@/Pages/Profile/Partials/UpdateProfileInformationForm';
import useTypedPage from '@/Hooks/useTypedPage';
import SectionBorder from '@/Components/SectionBorder';
import AppLayout from '@/Layouts/AppLayout';
import { Session } from '@/types';
interface Props {
sessions: Session[];
confirmsTwoFactorAuthentication: boolean;
}
export default function Show({
sessions,
confirmsTwoFactorAuthentication,
}: Props) {
const page = useTypedPage();
return (
<AppLayout
title={'Profile'}
renderHeader={() => (
<h2 className="font-semibold text-xl text-gray-800 dark:text-gray-200 leading-tight">
Profile
</h2>
)}
>
<div>
<div className="max-w-7xl mx-auto py-10 sm:px-6 lg:px-8">
{page.props.jetstream.canUpdateProfileInformation ? (
<div>
<UpdateProfileInformationForm user={page.props.auth.user!} />
<SectionBorder />
</div>
) : null}
{page.props.jetstream.canUpdatePassword ? (
<div className="mt-10 sm:mt-0">
<UpdatePasswordForm />
<SectionBorder />
</div>
) : null}
{page.props.jetstream.canManageTwoFactorAuthentication ? (
<div className="mt-10 sm:mt-0">
<TwoFactorAuthenticationForm
requiresConfirmation={confirmsTwoFactorAuthentication}
/>
<SectionBorder />
</div>
) : null}
<div className="mt-10 sm:mt-0">
<LogoutOtherBrowserSessions sessions={sessions} />
</div>
{page.props.jetstream.hasAccountDeletionFeatures ? (
<>
<SectionBorder />
<div className="mt-10 sm:mt-0">
<DeleteUserForm />
</div>
</>
) : null}
</div>
</div>
</AppLayout>
);
}