- can get data need to post
This commit is contained in:
@@ -3,14 +3,22 @@ import Card from "../../../ui/Card";
|
||||
import CardHeader from "../../../ui/CardHeader";
|
||||
import ChannelFields from "./ChannelFields";
|
||||
import type { FormTypes } from "../../../types/types";
|
||||
import { useGetOutputs } from "../hooks/useGetOutputs";
|
||||
|
||||
const ChannelCard = () => {
|
||||
const { values, errors, touched } = useFormikContext<FormTypes>();
|
||||
|
||||
const { values, errors, touched, setFieldValue } = useFormikContext<FormTypes>();
|
||||
const { query } = useGetOutputs(values?.format?.toLowerCase() || "json");
|
||||
const outputData = query?.data;
|
||||
return (
|
||||
<Card className="p-4 h-150 md:h-full">
|
||||
<CardHeader title={`Channel (${values?.format})`} />
|
||||
<ChannelFields errors={errors} touched={touched} values={values} />
|
||||
<ChannelFields
|
||||
errors={errors}
|
||||
touched={touched}
|
||||
values={values}
|
||||
outputData={outputData}
|
||||
onSetFieldValue={setFieldValue}
|
||||
/>
|
||||
<button
|
||||
type="submit"
|
||||
className="w-full md:w-1/4 text-white bg-green-700 hover:bg-green-800 font-small rounded-lg text-sm px-2 py-2.5"
|
||||
|
||||
Reference in New Issue
Block a user