mirror of
https://github.com/pterodactyl/panel.git
synced 2026-11-30 11:25:52 -05:00
Co-authored-by: Anthony <anthony@infraly.co> Co-authored-by: Sky Mulley <daniel.mulley@outlook.com>
26 lines
818 B
TypeScript
26 lines
818 B
TypeScript
import { type Schedule } from '@/api/server/schedules/queries';
|
|
import TaskDetailsModal from '@/components/server/schedules/TaskDetailsModal';
|
|
import { NewButton } from '@/components/elements/NewButton';
|
|
import { Dialog } from '@/components/elements/dialog';
|
|
import type { WithClassname } from '@/components/types';
|
|
|
|
interface Props extends WithClassname {
|
|
schedule: Schedule;
|
|
}
|
|
|
|
const NewTaskButton = ({ schedule, className }: Props) => {
|
|
return (
|
|
<Dialog.Trigger
|
|
trigger={({ onClick }) => (
|
|
<NewButton onClick={onClick} className={className}>
|
|
New task
|
|
</NewButton>
|
|
)}
|
|
>
|
|
{(dialog) => <TaskDetailsModal schedule={schedule} {...dialog} />}
|
|
</Dialog.Trigger>
|
|
);
|
|
};
|
|
|
|
export default NewTaskButton;
|