import { useWatch } from "react-hook-form";
import { ReferenceInput } from "@/components/ds/admin/reference-input";
import { AutocompleteInput } from "@/components/ds/admin/autocomplete-input";
import { useTranslate } from "ra-core";
import { contactOptionText } from "../misc/ContactOption";
interface EntityAutocompleteProps {
helperText?: boolean;
validate?: any;
}
export const EntityAutocomplete = ({
helperText = false,
validate,
}: EntityAutocompleteProps) => {
const translate = useTranslate();
const entityType = useWatch({ name: "entity_type" });
if (entityType === "contact") {
return (
);
}
if (entityType === "company") {
return (
);
}
if (entityType === "deal") {
return (
);
}
return null;
};