import React, { useState } from 'react';
import { Tabs, Modal, Button } from 'antd';
import SystemPanel from '../../system/panel';
import SystemUpsert from '../../system/upsert';
export default function render(props) {
const { oakFullpath, systems, oakExecutable, oakExecuting, platformId } = props.data;
const { addItem, removeItem, clean, execute, t } = props.methods;
const [createId, setCreateId] = useState('');
const [removeId, setRemoveId] = useState('');
if (oakFullpath) {
return (<>
{
clean();
setCreateId('');
}} footer={}>
{
clean();
setRemoveId('');
}} footer={}>
{t('confirmToRemove')}
{
if (action === 'add') {
const id = addItem({ platformId, config: { App: {} } });
setCreateId(id);
}
else if (action === 'remove') {
const systemId = systems[Number(key)].id;
setRemoveId(systemId);
}
}} items={systems?.length > 0 ?
systems.map((item, idx) => {
return {
label: item.name,
key: `${idx}`,
children: ()
};
})
: []}/>
>);
}
}