2023-01-11 02:18:59 +01:00
|
|
|
import { Form, FormRow } from 'react-basics';
|
2023-01-25 16:42:46 +01:00
|
|
|
import { useIntl } from 'react-intl';
|
2023-01-19 00:05:39 +01:00
|
|
|
import TimezoneSetting from 'components/pages/settings/profile/TimezoneSetting';
|
|
|
|
import DateRangeSetting from 'components/pages/settings/profile/DateRangeSetting';
|
|
|
|
import LanguageSetting from 'components/pages/settings/profile/LanguageSetting';
|
2023-01-28 06:53:13 +01:00
|
|
|
import ThemeSetting from 'components/pages/settings/profile/ThemeSetting';
|
2022-12-27 01:57:59 +01:00
|
|
|
import useUser from 'hooks/useUser';
|
2023-01-25 16:42:46 +01:00
|
|
|
import { labels } from 'components/messages';
|
2022-12-27 01:57:59 +01:00
|
|
|
|
|
|
|
export default function ProfileDetails() {
|
2023-01-11 17:33:43 +01:00
|
|
|
const { user } = useUser();
|
2023-01-11 02:18:59 +01:00
|
|
|
const { formatMessage } = useIntl();
|
2022-12-27 01:57:59 +01:00
|
|
|
|
|
|
|
if (!user) {
|
|
|
|
return null;
|
|
|
|
}
|
|
|
|
|
2023-01-11 02:18:59 +01:00
|
|
|
const { username, role } = user;
|
2022-12-27 01:57:59 +01:00
|
|
|
|
|
|
|
return (
|
2023-01-11 02:18:59 +01:00
|
|
|
<Form>
|
2023-01-25 16:42:46 +01:00
|
|
|
<FormRow label={formatMessage(labels.username)}>{username}</FormRow>
|
|
|
|
<FormRow label={formatMessage(labels.role)}>{role}</FormRow>
|
2023-01-31 06:44:07 +01:00
|
|
|
<FormRow label={formatMessage(labels.defaultDateRange)}>
|
|
|
|
<DateRangeSetting />
|
|
|
|
</FormRow>
|
2023-01-28 06:53:13 +01:00
|
|
|
<FormRow label={formatMessage(labels.language)}>
|
2023-01-11 02:18:59 +01:00
|
|
|
<LanguageSetting />
|
|
|
|
</FormRow>
|
2023-01-28 06:53:13 +01:00
|
|
|
<FormRow label={formatMessage(labels.timezone)}>
|
2023-01-11 02:18:59 +01:00
|
|
|
<TimezoneSetting />
|
|
|
|
</FormRow>
|
2023-01-25 16:42:46 +01:00
|
|
|
<FormRow label={formatMessage(labels.theme)}>
|
2023-01-11 02:18:59 +01:00
|
|
|
<ThemeSetting />
|
|
|
|
</FormRow>
|
|
|
|
</Form>
|
2022-12-27 01:57:59 +01:00
|
|
|
);
|
|
|
|
}
|