"use client";

import { FC } from "react";
/* eslint-disable react/display-name */
import {
  SelectInput,
  required,
  ReferenceInput,
  ReferenceField,
  TextField,
} from "react-admin";

export const SignalBotSelectInput =
  (source: string): FC =>
  () =>
    (
      <ReferenceInput
        label="Signal Bot"
        source={source}
        reference="signalBots"
        validate={[required()]}
      >
        <SelectInput optionText="phoneNumber" />
      </ReferenceInput>
    );

export const SignalBotField =
  (source: string): FC =>
  () =>
    (
      <ReferenceField label="Signal Bot" reference="signalBots" source={source}>
        <TextField source="phoneNumber" />
      </ReferenceField>
    );
