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

25 lines
570 B
TypeScript
Raw Normal View History

2023-02-13 12:41:30 +00:00
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>
);