import React from "react";
import WholeSiteDisplay from "./WholeSiteDisplay";
import TaxonomyInput from "./TaxonomyInput";
import MultiselectInput from "./MultiselectInput";

type Props = {
	contentType: string;
	value: any;
	onChange: (newValue: any) => void;
};

const ContentValueInput = ({ contentType, value, onChange }: Props) => {
	if (contentType === "whole_site") {
		return <WholeSiteDisplay />;
	}

	if (contentType === "taxonomy") {
		return <TaxonomyInput value={value} onChange={onChange} />;
	}

	return (
		<MultiselectInput
			contentType={contentType}
			value={value}
			onChange={onChange}
		/>
	);
};

export default ContentValueInput;
