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

40 lines
825 B
JavaScript
Raw Normal View History

2024-05-28 23:32:10 +00:00
/**
* External dependencies
*/
import { useState } from '@wordpress/element';
/**
* Internal dependencies
*/
import { Tabs } from './tabs';
2024-05-29 01:38:10 +00:00
import { SectionNav } from './section-nav';
2024-05-29 00:17:39 +00:00
import './style.scss';
2024-05-28 23:32:10 +00:00
const Settings = ( { params } ) => {
const settingsData = window.wcSettings?.admin?.settingsPages;
if ( ! settingsData ) {
return <div>Error getting data</div>;
}
return (
<>
2024-05-29 00:47:56 +00:00
<Tabs data={ settingsData } page={ params.page }>
2024-05-29 01:49:40 +00:00
<div className="woocommerce-settings-layout">
<div className="woocommerce-settings-section-nav">
<SectionNav
data={ settingsData[ params.page ] }
section={ params.section }
/>
</div>
<div className="woocommerce-settings-content">
<p>Content here</p>
</div>
2024-05-29 01:38:10 +00:00
</div>
2024-05-29 00:47:56 +00:00
</Tabs>
2024-05-28 23:32:10 +00:00
</>
);
};
2024-05-28 23:32:10 +00:00
export default Settings;