import { FC } from "react";
import { omit } from "lodash";
import { NumberInput, TextInput } from "@mantine/core";
import MpAuthDataInputProps from "../types/MpAuthDataInputProps";

const OzonInputs: FC<MpAuthDataInputProps> = props => {
    const restProps = omit(props, ["baseMarketplace"]);

    return (
        <>
            <NumberInput
                {...restProps}
                label={"Client-Id"}
                placeholder={"Введите Client-Id"}
                value={props.value?.["Client-Id"] || undefined}
                onChange={value =>
                    props.onChange({
                        ...props.value,
                        "Client-Id": value.toString(),
                    })
                }
            />
            <TextInput
                {...restProps}
                label={"Api-Key"}
                placeholder={"Введите Api-Key"}
                value={props.value?.["Api-Key"] || ""}
                onChange={value =>
                    props.onChange({
                        ...props.value,
                        "Api-Key": value.target.value,
                    })
                }
            />
        </>
    );
};

export default OzonInputs;
