import InlineCode from '@/components/InlineCode';
import { txToast } from '@/components/TxToaster';
import { Button } from '@/components/ui/button';
import { useOpenPromptDialog } from '@/hooks/dialogs';
import { useCloseAllSheets } from '@/hooks/sheets';
import { useGlobalStatus } from '@/hooks/status';
import { useBackendApi } from '@/hooks/fetch';
import { cn } from '@/lib/utils';
import { msToDuration } from '@/lib/dateTime';
import { PenLineIcon, PlayCircleIcon, PlusCircleIcon, XCircleIcon } from 'lucide-react';
import { useAdminPerms } from '@/hooks/auth';
//Prompt props
const browserTimezone = Intl.DateTimeFormat().resolvedOptions().timeZone;
const timezoneDiffMessage = (
Server's timezone: {window.txConsts.serverTimezone}
Your timezone: {browserTimezone}
Either use relative times, or make sure the scheduled is based on the server timezone.
)
const promptCommonProps = {
suggestions: ['+5', '+10', '+15', '+30'],
title: 'When should the server restart?',
message: (<>
Possible formats:
+MM relative time in minutes
(example: +15 for 15 minutes from now.)
HH:MM absolute 24-hour time
(example: 23:30 for 11:30 PM.)