import { useEffect, useState } from "react";
import {
Typography,
TextField,
Button,
RadioGroup,
Radio,
FormControlLabel,
Select,
} from "@mui/material";
import { Formik, Field, Form } from "formik";
import { DesktopDatePicker } from "@mui/x-date-pickers/DesktopDatePicker";
import MenuItem from "@mui/material/MenuItem";
import theme from "../../../../theme";
import { requestPrivileges } from "@root/services/privilegies.service";
import { usePrivilegeStore } from "@root/stores/privilegesStore";
import { useCartStore } from "@root/stores/cart";
import type { TextFieldProps } from "@mui/material";
type BonusType = "discount" | "privilege";
type LayerType = "privilege" | "service";
type FormValues = {
codeword: string;
description: string;
greetings: string;
dueTo: string;
activationCount: string;
privilegeId: string;
amount: string;
layer: string;
factor: string;
target: string;
threshold: string;
};
type CustomTextFieldProps = {
name: string;
label: string;
required?: boolean;
};
const CustomTextField = ({
name,
label,
required = false,
}: CustomTextFieldProps) => (
);
export const CreatePromocodeForm = () => {
const [dueTo, setDueTo] = useState(new Date());
const [bonusType, setBonusType] = useState("discount");
const [layerType, setLayerType] = useState("privilege");
const { privileges } = usePrivilegeStore();
const { cartData } = useCartStore();
const initialValues: FormValues = {
codeword: "",
description: "",
greetings: "",
dueTo: "",
activationCount: "",
privilegeId: "",
amount: "",
layer: "",
factor: "",
target: "",
threshold: "",
};
useEffect(() => {
requestPrivileges();
}, []);
const createPromocode = (values: FormValues) => {
console.log(values);
};
return (
{(props) => (
)}
);
};