link-stack/apps/link/metamigo-add/_components/whatsapp/bots/shared.tsx
2023-08-25 11:04:38 +02:00

33 lines
678 B
TypeScript

"use client";
/* eslint-disable react/display-name */
import {
SelectInput,
required,
ReferenceInput,
ReferenceField,
TextField,
} from "react-admin";
export const WhatsAppBotSelectInput = (source: string) => () =>
(
<ReferenceInput
label="WhatsApp Bot"
reference="whatsappBots"
source={source}
validate={[required()]}
>
<SelectInput optionText="phoneNumber" />
</ReferenceInput>
);
export const WhatsAppBotField = (source: string) => () =>
(
<ReferenceField
label="WhatsApp Bot"
reference="whatsappBots"
source={source}
>
<TextField source="phoneNumber" />
</ReferenceField>
);