1
0
Fork 0
mirror of https://github.com/jellyfin/jellyfin-web synced 2025-03-30 19:56:21 +00:00
jellyfin-web/src/components/dashboard/users/SectionTabs.tsx

51 lines
1.6 KiB
TypeScript
Raw Normal View History

2022-01-02 02:40:11 +03:00
import React, { FunctionComponent } from 'react';
import globalize from '../../../scripts/globalize';
type IProps = {
activeTab: string;
2023-05-02 15:54:53 -04:00
};
2022-01-02 02:40:11 +03:00
2022-02-18 14:27:39 +03:00
const createLinkElement = (activeTab: string) => ({
2022-01-02 02:40:11 +03:00
__html: `<a href="#"
is="emby-linkbutton"
data-role="button"
class="${activeTab === 'useredit' ? 'ui-btn-active' : ''}"
2023-09-25 00:00:36 -04:00
onclick="Dashboard.navigate('/dashboard/users/profile', true);">
2022-01-02 02:40:11 +03:00
${globalize.translate('Profile')}
</a>
<a href="#"
is="emby-linkbutton"
data-role="button"
class="${activeTab === 'userlibraryaccess' ? 'ui-btn-active' : ''}"
2023-09-25 00:00:36 -04:00
onclick="Dashboard.navigate('/dashboard/users/access', true);">
2022-01-02 02:40:11 +03:00
${globalize.translate('TabAccess')}
</a>
<a href="#"
is="emby-linkbutton"
data-role="button"
class="${activeTab === 'userparentalcontrol' ? 'ui-btn-active' : ''}"
2023-09-25 00:00:36 -04:00
onclick="Dashboard.navigate('/dashboard/users/parentalcontrol', true);">
2022-01-02 02:40:11 +03:00
${globalize.translate('TabParentalControl')}
</a>
<a href="#"
is="emby-linkbutton"
data-role="button"
class="${activeTab === 'userpassword' ? 'ui-btn-active' : ''}"
2023-09-25 00:00:36 -04:00
onclick="Dashboard.navigate('/dashboard/users/password', true);">
2022-01-02 02:40:11 +03:00
${globalize.translate('HeaderPassword')}
</a>`
});
2023-03-29 00:38:22 -04:00
const SectionTabs: FunctionComponent<IProps> = ({ activeTab }: IProps) => {
2022-01-02 02:40:11 +03:00
return (
<div
data-role='controlgroup'
data-type='horizontal'
className='localnav'
2022-02-18 14:27:39 +03:00
dangerouslySetInnerHTML={createLinkElement(activeTab)}
2022-01-02 02:40:11 +03:00
/>
);
};
export default SectionTabs;