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

38 lines
653 B
JavaScript
Raw Normal View History

2024-05-29 03:41:08 +00:00
/**
* Internal dependencies
*/
import { SettingsCheckbox } from './components';
export const Content = ( { data } ) => {
const { settings } = data;
2024-05-29 05:24:19 +00:00
console.log( settings );
2024-05-29 03:41:08 +00:00
return (
<div>
{ settings.map( ( setting ) => {
switch ( setting.type ) {
case 'title':
2024-05-29 05:24:19 +00:00
return (
2024-05-29 10:39:02 +00:00
<div
key={ setting.id }
className="woocommerce-settings-element"
>
2024-05-29 05:24:19 +00:00
<h3>{ setting.title }</h3>
</div>
);
2024-05-29 03:41:08 +00:00
case 'checkbox':
return (
<SettingsCheckbox
setting={ setting }
key={ setting.id }
/>
);
default:
return null;
}
} ) }
</div>
);
};