link-stack/apps/metamigo-frontend/components/whatsapp/bots/shared.tsx

32 lines
663 B
TypeScript
Raw Normal View History

2023-03-15 12:17:43 +00:00
/* eslint-disable react/display-name */
2023-02-13 12:41:30 +00:00
import {
SelectInput,
required,
ReferenceInput,
ReferenceField,
TextField,
} from "react-admin";
2023-03-15 12:17:43 +00:00
export const WhatsAppBotSelectInput = (source: string) => () =>
(
<ReferenceInput
label="WhatsApp Bot"
reference="whatsappBots"
source={source}
validate={[required()]}
>
<SelectInput optionText="phoneNumber" />
</ReferenceInput>
);
2023-02-13 12:41:30 +00:00
2023-03-15 12:17:43 +00:00
export const WhatsAppBotField = (source: string) => () =>
(
<ReferenceField
label="WhatsApp Bot"
reference="whatsappBots"
source={source}
>
<TextField source="phoneNumber" />
</ReferenceField>
);