2020-03-19 05:36:19 +00:00
|
|
|
import React, { useState } from 'react';
|
2022-02-27 17:35:27 +00:00
|
|
|
import { Schedule } from '@definitions/user';
|
2020-03-19 05:36:19 +00:00
|
|
|
import TaskDetailsModal from '@/components/server/schedules/TaskDetailsModal';
|
2020-07-05 00:00:19 +00:00
|
|
|
import Button from '@/components/elements/Button';
|
2020-10-15 03:13:36 +00:00
|
|
|
import tw from 'twin.macro';
|
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) => {
|
|
|
|
const [ visible, setVisible ] = useState(false);
|
2020-03-19 05:36:19 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
<>
|
2021-05-01 18:24:18 +00:00
|
|
|
<TaskDetailsModal schedule={schedule} visible={visible} onModalDismissed={() => setVisible(false)}/>
|
2020-10-15 03:13:36 +00:00
|
|
|
<Button onClick={() => setVisible(true)} css={tw`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
|
|
|
</>
|
|
|
|
);
|
|
|
|
};
|