2022-03-03 03:37:56 +03:00
|
|
|
import React, { FunctionComponent, useCallback, useEffect, useState } from 'react';
|
2022-06-29 03:31:55 +03:00
|
|
|
import SectionTabs from '../components/dashboard/users/SectionTabs';
|
|
|
|
import UserPasswordForm from '../components/dashboard/users/UserPasswordForm';
|
|
|
|
import { getParameterByName } from '../utils/url';
|
|
|
|
import SectionTitleContainer from '../components/dashboard/elements/SectionTitleContainer';
|
|
|
|
import Page from '../components/Page';
|
2022-01-05 20:35:58 +03:00
|
|
|
|
|
|
|
const UserPasswordPage: FunctionComponent = () => {
|
2022-04-11 11:20:53 -04:00
|
|
|
const userId = getParameterByName('userId');
|
2022-01-05 20:35:58 +03:00
|
|
|
const [ userName, setUserName ] = useState('');
|
|
|
|
|
2022-03-03 03:37:56 +03:00
|
|
|
const loadUser = useCallback(() => {
|
|
|
|
window.ApiClient.getUser(userId).then(function (user) {
|
|
|
|
if (!user.Name) {
|
|
|
|
throw new Error('Unexpected null user.Name');
|
|
|
|
}
|
2022-01-05 20:35:58 +03:00
|
|
|
setUserName(user.Name);
|
|
|
|
});
|
|
|
|
}, [userId]);
|
2022-03-03 03:37:56 +03:00
|
|
|
useEffect(() => {
|
|
|
|
loadUser();
|
|
|
|
}, [loadUser]);
|
2022-01-05 20:35:58 +03:00
|
|
|
|
|
|
|
return (
|
2022-06-29 03:31:55 +03:00
|
|
|
<Page
|
|
|
|
id='userPasswordPage'
|
|
|
|
className='mainAnimatedPage type-interior userPasswordPage'
|
|
|
|
>
|
2022-01-05 20:35:58 +03:00
|
|
|
<div className='content-primary'>
|
2022-06-29 02:17:10 +03:00
|
|
|
<div className='verticalSection'>
|
|
|
|
<SectionTitleContainer
|
|
|
|
title={userName}
|
|
|
|
url='https://docs.jellyfin.org/general/server/users/'
|
|
|
|
/>
|
|
|
|
</div>
|
2022-01-05 20:35:58 +03:00
|
|
|
<SectionTabs activeTab='userpassword'/>
|
|
|
|
<div className='readOnlyContent'>
|
|
|
|
<UserPasswordForm
|
|
|
|
userId={userId}
|
|
|
|
/>
|
|
|
|
</div>
|
|
|
|
</div>
|
2022-06-29 03:31:55 +03:00
|
|
|
</Page>
|
|
|
|
|
2022-01-05 20:35:58 +03:00
|
|
|
);
|
|
|
|
};
|
|
|
|
|
|
|
|
export default UserPasswordPage;
|