Skip to content

Commit

Permalink
fix: default empty state to title before resource in lowercase (#402)
Browse files Browse the repository at this point in the history
  • Loading branch information
FacundoSpira authored Sep 6, 2024
1 parent af95d6b commit a554eaf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changeset/eight-trainers-judge.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@premieroctet/next-admin": patch
---

default resource names to title before the resource in lowercase
6 changes: 5 additions & 1 deletion packages/next-admin/src/components/EmptyState.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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 (
<div className="py-10 text-center">
Expand Down

0 comments on commit a554eaf

Please sign in to comment.