App directory #4

This commit is contained in:
Darren Clarke 2023-06-28 12:55:24 +00:00 committed by GitHub
parent 69706053c6
commit 4d743c5e67
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
86 changed files with 223 additions and 107 deletions

View file

@ -0,0 +1,25 @@
"use client";
import {
List,
ListProps,
Datagrid,
DateField,
TextField,
BooleanField,
} from "react-admin";
const WhatsappMessageList = (props: ListProps) => (
<List {...props} exporter={false}>
<Datagrid rowClick="show">
<TextField source="phoneNumber" />
<TextField source="description" />
<BooleanField source="isVerified" />
<DateField source="createdAt" />
<DateField source="updatedAt" />
<TextField source="createdBy" />
</Datagrid>
</List>
);
export default WhatsappMessageList;

View file

@ -0,0 +1,31 @@
"use client";
import {
Show,
ShowProps,
SimpleShowLayout,
TextField,
ReferenceManyField,
Datagrid,
} from "react-admin";
const WhatsappMessageShow = (props: ShowProps) => (
<Show {...props} title="Whatsapp Message">
<SimpleShowLayout>
<TextField source="waMessage" />
<TextField source="createdAt" />
<ReferenceManyField
label="Attachments"
reference="whatsappAttachments"
target="whatsappMessageId"
>
<Datagrid rowClick="show">
<TextField source="id" />
<TextField source="createdAt" />
</Datagrid>
</ReferenceManyField>
</SimpleShowLayout>
</Show>
);
export default WhatsappMessageShow;

View file

@ -0,0 +1,12 @@
"use client";
import WhatsappMessageIcon from "@mui/icons-material/Message";
import WhatsappMessageList from "./WhatsappMessageList";
import WhatsappMessageShow from "./WhatsappMessageShow";
// eslint-disable-next-line import/no-anonymous-default-export
export default {
list: WhatsappMessageList,
show: WhatsappMessageShow,
icon: WhatsappMessageIcon,
};