File size: 672 Bytes
1e92f2d
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
import { SubscriptionManager } from '@automattic/data-stores';
import { UserSettings } from 'calypso/landing/subscriptions/components/user-settings';
import TabView from '../tab-view';

const Settings = () => {
	const {
		data: settings,
		isInitialLoading,
		isLoading,
		error,
	} = SubscriptionManager.useUserSettingsQuery();

	// todo: translate when we have agreed on the error message
	const errorMessage = error ? 'An error occurred while fetching your subscription settings.' : '';

	return (
		<TabView errorMessage={ errorMessage } isLoading={ isInitialLoading || isLoading }>
			<UserSettings value={ settings } />
		</TabView>
	);
};

export default Settings;