misc_pterodactyl-panel/resources/scripts/components/server/schedules/NewTaskButton.tsx

22 lines
673 B
TypeScript
Raw Normal View History

2020-03-19 05:36:19 +00:00
import React, { useState } from 'react';
import { Schedule } from '@/api/server/schedules/getServerSchedules';
2020-03-19 05:36:19 +00:00
import TaskDetailsModal from '@/components/server/schedules/TaskDetailsModal';
import { Button } from '@/components/elements/button/index';
2020-03-19 05:36:19 +00:00
interface Props {
schedule: Schedule;
2020-03-19 05:36:19 +00:00
}
export default ({ schedule }: Props) => {
const [visible, setVisible] = useState(false);
2020-03-19 05:36:19 +00:00
return (
<>
<TaskDetailsModal schedule={schedule} visible={visible} onModalDismissed={() => setVisible(false)} />
<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
</>
);
};