import { selectTab, TAB_IDS } from '../../../utils/tabSelector';
const TodoSettingsBlock = ( { todosData, className = '' } ) => {
if ( todosData.length === 0 ) {
return null;
}
return (
{ todosData.slice( 0, 5 ).map( ( todo ) => (
{
if ( todo.action.type === 'tab' ) {
const tabId =
TAB_IDS[ todo.action.tab.toUpperCase() ];
await selectTab( tabId, todo.action.section );
} else if ( todo.action.type === 'external' ) {
window.open( todo.action.url, '_blank' );
}
} }
/>
) ) }
);
};
const TodoItem = ( { title, description, isCompleted, onClick } ) => {
return (
{ isCompleted && (
) }
{ title }
{ description && (
{ description }
) }
);
};
export default TodoSettingsBlock;