muffin-admin 1.45.5 → 1.45.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "muffin-admin",
3
- "version": "1.45.5",
3
+ "version": "1.45.7",
4
4
  "description": "NPM package for https://github.com/klen/muffin-admin",
5
5
  "files": [
6
6
  "src",
@@ -10,9 +10,13 @@ export function LinkAction({ field, icon, ...props }: AdminShowLink & { resource
10
10
  const currentResource = useResourceContext()
11
11
  if (!record) return null
12
12
 
13
- icon = icon || adminProps?.resources[props.resource]?.icon
13
+ const resource = adminProps?.resources.find((r) => r.name === props.resource)
14
14
 
15
15
  return (
16
- <LinkButton {...props} icon={icon} filters={{ [currentResource]: record[field || "id"] }} />
16
+ <LinkButton
17
+ {...props}
18
+ icon={icon || resource?.icon}
19
+ filters={{ [currentResource]: encodeURIComponent(record[field || "id"]) }}
20
+ />
17
21
  )
18
22
  }