import React from 'react';
import PropTypes from 'prop-types';
import { Card, CardBody, TabPanel } from '@wordpress/components';
import { GroupCustomers } from './GroupCustomers';
import { GroupNotes } from './GroupNotes';
import { GroupRates } from './GroupRates';
import { GroupPunchout } from './GroupPunchout';
import { GroupChildGroups } from './GroupChildGroups';
export const GroupTabs = (props) => {
const tabs = [
{
name: 'customers',
title: 'Customers',
},
{
name: 'children',
title: 'Child groups',
},
{
name: 'rates',
title: 'Shipping flat rates',
},
{
name: 'punchout',
title: 'Punchout',
},
{
name: 'notes',
title: 'Notes',
},
];
const renderTab = (tab: string) => {
switch (tab) {
case 'customers':
return (
);
case 'children':
return (
);
case 'rates':
return (
);
case 'punchout':
return (
);
case 'notes':
return ;
default:
return <>>;
}
};
return (
<>
{props.group && (
{(tab) => (
{renderTab(tab.name)}
)}
)}
>
);
};
GroupTabs.propTypes = {
group: PropTypes.object, // Paginated customers object.
handleUpdate: PropTypes.func, // Callback to trigger refreshing parent component.
handleChangePage: PropTypes.func, // Callback for sending updated page number to parent component.
};