2026-10-05 18:10:18 -04:00
|
|
|
import { type Schedule } from '@/api/server/schedules/queries';
|
2020-03-18 22:36:19 -07:00
|
|
|
import TaskDetailsModal from '@/components/server/schedules/TaskDetailsModal';
|
2026-10-05 18:10:18 -04:00
|
|
|
import { NewButton } from '@/components/elements/NewButton';
|
|
|
|
|
import { Dialog } from '@/components/elements/dialog';
|
|
|
|
|
import type { WithClassname } from '@/components/types';
|
2020-03-18 22:36:19 -07:00
|
|
|
|
2026-10-05 18:10:18 -04:00
|
|
|
interface Props extends WithClassname {
|
2020-04-10 10:46:00 -07:00
|
|
|
schedule: Schedule;
|
2020-03-18 22:36:19 -07:00
|
|
|
}
|
|
|
|
|
|
2026-10-05 18:10:18 -04:00
|
|
|
const NewTaskButton = ({ schedule, className }: Props) => {
|
2020-03-18 22:36:19 -07:00
|
|
|
return (
|
2026-10-05 18:10:18 -04:00
|
|
|
<Dialog.Trigger
|
|
|
|
|
trigger={({ onClick }) => (
|
|
|
|
|
<NewButton onClick={onClick} className={className}>
|
|
|
|
|
New task
|
|
|
|
|
</NewButton>
|
|
|
|
|
)}
|
|
|
|
|
>
|
|
|
|
|
{(dialog) => <TaskDetailsModal schedule={schedule} {...dialog} />}
|
|
|
|
|
</Dialog.Trigger>
|
2020-03-18 22:36:19 -07:00
|
|
|
);
|
|
|
|
|
};
|
2026-10-05 18:10:18 -04:00
|
|
|
|
|
|
|
|
export default NewTaskButton;
|