woocommerce/plugins/woocommerce-admin/client/settings/index.js

32 lines
624 B
JavaScript

/**
* External dependencies
*/
import { useState } from '@wordpress/element';
/**
* Internal dependencies
*/
import { Tabs } from './tabs';
import { SectionNav } from './section-nav';
import './style.scss';
const Settings = ( { params } ) => {
const settingsData = window.wcSettings?.admin?.settingsPages;
if ( ! settingsData ) {
return <div>Error getting data</div>;
}
return (
<>
<Tabs data={ settingsData } page={ params.page }>
<div className="woocommerce-settings-section-nav">
<SectionNav data={ settingsData[ params.page ] } />
</div>
</Tabs>
</>
);
};
export default Settings;