Improving Cartouche

This commit is contained in:
2025-05-02 11:45:45 +02:00
parent f878fa7886
commit ba46c10449
3 changed files with 19 additions and 10 deletions

View File

@@ -171,6 +171,10 @@
} }
}, },
"schemas": { "schemas": {
"created_by": "Created by",
"created_at": "Created at",
"updated_by": "Updated by",
"updated_at": "Updated at",
"individual": { "individual": {
"type": "Individual", "type": "Individual",
"lastname": "Lastname", "lastname": "Lastname",

View File

@@ -171,6 +171,10 @@
} }
}, },
"schemas": { "schemas": {
"created_by": "Créé par",
"created_at": "Créé le",
"updated_by": "Modifié par",
"updated_at": "Modifié le",
"individual": { "individual": {
"type": "Particulier", "type": "Particulier",
"middlename": "Autres prénoms", "middlename": "Autres prénoms",

View File

@@ -1,6 +1,7 @@
import { useTranslation } from "@refinedev/core"; import { useTranslation } from "@refinedev/core";
import { useContext } from "react"; import { useContext } from "react";
import { FirmContext } from "../contexts/FirmContext"; import { FirmContext } from "../contexts/FirmContext";
import Grid2 from '@mui/material/Grid2';
type CartoucheProps = { type CartoucheProps = {
record: any record: any
@@ -11,16 +12,16 @@ const Cartouche = (props: CartoucheProps) => {
const { translate: t } = useTranslation(); const { translate: t } = useTranslation();
return ( return (
<> <>
<ul> <Grid2 container spacing={0}>
<li> <Grid2 size={2}>{t("schemas.created_by")}:</Grid2>
{t("resource.created_at")}: {record.created_at} {t("resource.created_by")}: <Grid2 size={4}><AuthorField partnerId={record.created_by} /></Grid2>
<AuthorField partnerId={record.created_by} /> <Grid2 size={2}>{t("schemas.created_at")}:</Grid2>
</li> <Grid2 size={4}>{new Date(record.created_at).toLocaleString()}</Grid2>
<li> <Grid2 size={2}>{t("schemas.updated_by")}:</Grid2>
{t("resource.updated_at")}: {record.updated_at} {t("resource.updated_by")}: <Grid2 size={4}><AuthorField partnerId={record.updated_by} /></Grid2>
<AuthorField partnerId={record.updated_by} /> <Grid2 size={2}>{t("schemas.updated_at")}:</Grid2>
</li> <Grid2 size={4}>{new Date(record.updated_at).toLocaleString()}</Grid2>
</ul> </Grid2>
</> </>
) )
} }