This commit is contained in:
Darren Clarke 2023-07-18 12:26:57 +00:00
parent 7ca5f2d45a
commit f901f203b0
302 changed files with 9897 additions and 10332 deletions

View file

@ -1,44 +0,0 @@
import { FC } from "react";
import {
List,
Datagrid,
DateField,
TextField,
ReferenceField,
DeleteButton,
ListProps,
} from "react-admin";
import { useSession } from "next-auth/react";
type DeleteNotSelfButtonProps = {
record?: any;
};
const DeleteNotSelfButton: FC<DeleteNotSelfButtonProps> = (props: any) => {
const { data: session } = useSession();
return (
// @ts-ignore
<DeleteButton
disabled={session?.user?.email === props.record.userId}
{...props}
/>
);
};
export const AccountList = (props: ListProps) => (
<List {...props} exporter={false}>
<Datagrid rowClick="edit">
<ReferenceField source="userId" reference="users">
<TextField source="email" />
</ReferenceField>
<TextField source="providerType" />
<TextField source="providerId" />
<TextField source="providerAccountId" />
<DateField source="createdAt" />
<DateField source="updatedAt" />
<DeleteNotSelfButton />
</Datagrid>
</List>
);
export default AccountList;