From a554eaf519924e86ea3db29a219893799df7085d Mon Sep 17 00:00:00 2001 From: Facundo Spira Date: Fri, 6 Sep 2024 10:36:03 +0200 Subject: [PATCH] fix: default empty state to title before resource in lowercase (#402) --- .changeset/eight-trainers-judge.md | 5 +++++ packages/next-admin/src/components/EmptyState.tsx | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) create mode 100644 .changeset/eight-trainers-judge.md diff --git a/.changeset/eight-trainers-judge.md b/.changeset/eight-trainers-judge.md new file mode 100644 index 00000000..6820963a --- /dev/null +++ b/.changeset/eight-trainers-judge.md @@ -0,0 +1,5 @@ +--- +"@premieroctet/next-admin": patch +--- + +default resource names to title before the resource in lowercase diff --git a/packages/next-admin/src/components/EmptyState.tsx b/packages/next-admin/src/components/EmptyState.tsx index 0bc6ddb3..8bebcbd3 100644 --- a/packages/next-admin/src/components/EmptyState.tsx +++ b/packages/next-admin/src/components/EmptyState.tsx @@ -21,7 +21,11 @@ const EmptyState = ({ const hasCreatePermission = !modelOptions?.permissions || modelOptions?.permissions?.includes("create"); - const resourceName = t(`model.${resource}.name`, {}, resource.toLowerCase()); + const resourceName = t( + `model.${resource}.name`, + {}, + modelOptions?.title ?? resource.toLowerCase() + ); return (