2020-03-19 05:36:19 +00:00
|
|
|
import React, { useState } from 'react';
|
2020-04-10 17:46:00 +00:00
|
|
|
import { Schedule } from '@/api/server/schedules/getServerSchedules';
|
2020-03-19 05:36:19 +00:00
|
|
|
import TaskDetailsModal from '@/components/server/schedules/TaskDetailsModal';
|
2022-06-20 19:28:27 +00:00
|
|
|
import { Button } from '@/components/elements/button/index';
|
2020-03-19 05:36:19 +00:00
|
|
|
|
|
|
|
interface Props {
|
2020-04-10 17:46:00 +00:00
|
|
|
schedule: Schedule;
|
2020-03-19 05:36:19 +00:00
|
|
|
}
|
|
|
|
|
2020-04-10 17:46:00 +00:00
|
|
|
export default ({ schedule }: Props) => {
|
2022-06-26 19:13:52 +00:00
|
|
|
const [visible, setVisible] = useState(false);
|
2020-03-19 05:36:19 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
2022-06-26 19:13:52 +00:00
|
|
|
<TaskDetailsModal schedule={schedule} visible={visible} onModalDismissed={() => setVisible(false)} />
|
2022-06-20 19:28:27 +00:00
|
|
|
<Button onClick={() => setVisible(true)} className={'flex-1'}>
|
2020-03-19 05:36:19 +00:00
|
|
|
New Task
|
2020-07-05 00:00:19 +00:00
|
|
|
</Button>
|
2020-03-19 05:36:19 +00:00
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|