import{T as y,u as b,j as i,A as g,d as v,b as O,a as _}from"./dataProvider-3f13e24d.js";import{r as u}from"./index-76fb7be0.js";import{P as h}from"./index-8d47fad6.js";import{s as P,f as j}from"./sanitizeFieldRestProps-fb2f7069.js";import{u as F}from"./useRecordContext-3e1d0ecf.js";import{L as T}from"./Labeled-920c48dc.js";var a=globalThis&&globalThis.__assign||function(){return a=Object.assign||function(e){for(var t,n=1,r=arguments.length;n<r;n++){t=arguments[n];for(var o in t)Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o])}return e},a.apply(this,arguments)},x=globalThis&&globalThis.__rest||function(e,t){var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(n[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,r=Object.getOwnPropertySymbols(e);o<r.length;o++)t.indexOf(r[o])<0&&Object.prototype.propertyIsEnumerable.call(e,r[o])&&(n[r[o]]=e[r[o]]);return n},d=function(e){var t=e.className,n=e.source,r=n===void 0?"":n,o=e.render,l=x(e,["className","source","render"]),c=F(e);return u.useMemo(function(){return c?u.createElement(y,a({component:"span",variant:"body2",className:t},P(l)),o(c,r)):null},[t,c,r,o,l])};d.propTypes=a(a(a({},y.propTypes),j),{render:h.func.isRequired});const R={title:"Blocks/Fields/FunctionField",component:d,parameters:{layout:"centered"},decorators:[e=>S(e)],args:{record:b[0]}},s={render:e=>i(d,{source:"name",render:n=>_("div",{children:["Custom render: ",n.name," ",n.role]}),...e})},S=e=>i(g,{dataProvider:v,i18nProvider:O,children:i(T,{children:e()})});var m,p,f;s.parameters={...s.parameters,docs:{...(m=s.parameters)==null?void 0:m.docs,source:{originalSource:`{
  render: props => {
    const functionReneder = (record: any) => {
      return <div>Custom render: {record.name} {record.role}</div>;
    };
    return <FunctionField source="name" render={functionReneder} {...props} />;
  }
}`,...(f=(p=s.parameters)==null?void 0:p.docs)==null?void 0:f.source}}};const w=["Default"],I=Object.freeze(Object.defineProperty({__proto__:null,Default:s,__namedExportsOrder:w,default:R},Symbol.toStringTag,{value:"Module"}));export{s as D,I as F};
