import React, { ReactElement, useState } from 'react'; import Head from 'next/head'; import { Formik, Form, Field } from 'formik'; import axios from 'axios'; import { mdiBookOpenPageVariant, mdiCheck } from '@mdi/js'; import CardBox from '../../components/CardBox'; import LayoutAuthenticated from '../../layouts/Authenticated'; import SectionMain from '../../components/SectionMain'; import SectionTitleLineWithButton from '../../components/SectionTitleLineWithButton'; import BaseButton from '../../components/BaseButton'; import BaseButtons from '../../components/BaseButtons'; import FormField from '../../components/FormField'; import { getPageTitle } from '../../config'; import { SelectFieldMany } from '../../components/SelectFieldMany'; import SelectField from '../../components/SelectField'; const BulkAdjustPage = () => { const initialValues = { userIds: [], entry_type: 'debit_manual_adjustment', leave_bucket: 'regular_pto', amount_hours: 0, amount_days: 0, memo: '', }; const handleSubmit = async (values, { resetForm }) => { try { await axios.post('/pto_journal_entries/bulk-adjust', { data: values }); alert('Bulk adjustment applied successfully'); resetForm(); } catch (error) { console.error('Failed to apply adjustment:', error); alert('Failed to apply adjustment'); } }; return ( <>