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

27 lines
461 B
JavaScript
Raw Normal View History

2024-05-29 01:35:45 +00:00
/**
* External dependencies
*/
import {
__experimentalItemGroup as ItemGroup,
__experimentalItem as Item,
} from '@wordpress/components';
export const Subnav = ( { data } ) => {
const { sections } = data;
const sectionKeys = Object.keys( sections );
if ( sectionKeys.length === 1 ) {
return null;
}
return (
<>
<ItemGroup>
{ sectionKeys.map( ( key ) => (
<Item>{ sections[ key ].label }</Item>
) ) }
</ItemGroup>
</>
);
};