Device manager - data fetching (PSG-637) (#9151)
* add session manager tab to user settings * fussy import ordering * i18n * extract device fetching logic into hook * use new extended device type in device tile, add verified metadata * add current session section, test * tidy * update types for DeviceWithVerification
This commit is contained in:
parent
4e30d3c0fc
commit
b7872f2ff7
12 changed files with 434 additions and 13 deletions
|
@ -17,16 +17,26 @@ limitations under the License.
|
|||
import React from 'react';
|
||||
|
||||
import { _t } from "../../../../../languageHandler";
|
||||
import Spinner from '../../../elements/Spinner';
|
||||
import { useOwnDevices } from '../../devices/useOwnDevices';
|
||||
import DeviceTile from '../../devices/DeviceTile';
|
||||
import SettingsSubsection from '../../shared/SettingsSubsection';
|
||||
import SettingsTab from '../SettingsTab';
|
||||
|
||||
const SessionManagerTab: React.FC = () => {
|
||||
const { devices, currentDeviceId, isLoading } = useOwnDevices();
|
||||
|
||||
const currentDevice = devices[currentDeviceId];
|
||||
return <SettingsTab heading={_t('Sessions')}>
|
||||
<SettingsSubsection
|
||||
heading={_t('Current session')}
|
||||
// TODO session content coming here
|
||||
// in next PR
|
||||
/>
|
||||
data-testid='current-session-section'
|
||||
>
|
||||
{ isLoading && <Spinner /> }
|
||||
{ !!currentDevice && <DeviceTile
|
||||
device={currentDevice}
|
||||
/> }
|
||||
</SettingsSubsection>
|
||||
</SettingsTab>;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue