/* eslint-disable @typescript-eslint/no-explicit-any */ import { Field, useFormikContext, type FormikTouched } from "formik"; import FormGroup from "../components/FormGroup"; import { useEffect, useState } from "react"; import { faEyeSlash, faEye } from "@fortawesome/free-solid-svg-icons"; import { FontAwesomeIcon } from "@fortawesome/react-fontawesome"; import type { BearerTypeFieldType, InitialValuesForm } from "../../../types/types"; import { toast } from "sonner"; import type { UseQueryResult } from "@tanstack/react-query"; type ChannelFieldsProps = { touched: FormikTouched; isSubmitting: boolean; backOfficeData: UseQueryResult; format?: string; }; const ChannelFields = ({ touched, isSubmitting, format }: ChannelFieldsProps) => { const [showPwd, setShowPwd] = useState(false); const { submitCount, isValid, values, errors } = useFormikContext(); const ValidationToastOnce = () => { useEffect(() => { if (submitCount > 0 && !isValid) { toast.error("Check fields are filled in"); } }, []); return null; }; return ( <> {format?.toLowerCase() !== "bof2" && format?.toLowerCase() !== "json" ? ( <>
Format coming soon

Output configuration currently supports JSON or{" "} BOF2.
More formats will be added in future updates.

) : ( <>
setShowPwd((s) => !s)} icon={showPwd ? faEyeSlash : faEye} />
{/* Overview quality and scale */} {/* propOverviewImageScaleFactor cropSizeFactor */} {format?.toLowerCase() === "bof2" && ( <>

{values.format} Constants

{values.format} Lane ID Config

)}
)} ); }; export default ChannelFields;