import{c as V,T as C,s as w,j as S,u as I,A as L,d as z,b as B}from"./dataProvider-3f13e24d.js";import{r as s}from"./index-76fb7be0.js";import{P as o}from"./index-8d47fad6.js";import{g as m}from"./_baseAssignValue-4b27bc5d.js";import{s as p,f as M}from"./sanitizeFieldRestProps-fb2f7069.js";import{L as F}from"./Link-ab6162f7.js";import{u as X}from"./useRecordContext-3e1d0ecf.js";var l=globalThis&&globalThis.__assign||function(){return l=Object.assign||function(e){for(var t,a=1,r=arguments.length;a<r;a++){t=arguments[a];for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n])}return e},l.apply(this,arguments)},q=globalThis&&globalThis.__rest||function(e,t){var a={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&t.indexOf(r)<0&&(a[r]=e[r]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var n=0,r=Object.getOwnPropertySymbols(e);n<r.length;n++)t.indexOf(r[n])<0&&Object.prototype.propertyIsEnumerable.call(e,r[n])&&(a[r[n]]=e[r[n]]);return a},g=function(e){var t,a=e.className,r=e.emptyText,n=e.source,c=e.title,N=e.src,f=e.target,y=e.download,v=e.ping,b=e.rel,u=q(e,["className","emptyText","source","title","src","target","download","ping","rel"]),O=X(e),i=m(O,n),k=V();if(!i)return r?s.createElement(C,l({component:"span",variant:"body2",className:a},p(u)),r&&k(r,{_:r})):s.createElement(h,l({className:a},p(u)));if(Array.isArray(i))return s.createElement(H,l({className:a},p(u)),i.map(function(T,R){var _=m(T,c)||c,A=m(T,N)||c;return s.createElement("li",{key:R},s.createElement(F,{href:A,title:_,target:f,download:y,ping:v,rel:b,variant:"body2",onClick:function(D){return D.stopPropagation()}},_))}));var P=((t=m(O,c))===null||t===void 0?void 0:t.toString())||c;return s.createElement(h,l({className:a},p(u)),s.createElement(F,{href:i==null?void 0:i.toString(),title:P,target:f,download:y,ping:v,rel:b,variant:"body2"},P))};g.propTypes=l(l({},M),{src:o.string,title:o.string,target:o.string,download:o.oneOfType([o.bool,o.string]),ping:o.string,rel:o.string});var G="RaFileField",h=w("div",{name:G,overridesResolver:function(e,t){return t.root}})({display:"inline-block"}),H=w("ul")({display:"inline-block"});const J={title:"Blocks/Fields/FileField",component:g,parameters:{layout:"centered"},decorators:[e=>K(e)]},d={render:e=>S(g,{source:"name",title:"Presentation",...e,record:I[0]})},K=e=>S(L,{dataProvider:z,i18nProvider:B,children:e()});var x,E,j;d.parameters={...d.parameters,docs:{...(x=d.parameters)==null?void 0:x.docs,source:{originalSource:`{
  render: props => {
    return <FileField source="name" title="Presentation" {...{
      ...props,
      record: users[0]
    }} />;
  }
}`,...(j=(E=d.parameters)==null?void 0:E.docs)==null?void 0:j.source}}};const Q=["Default"],te=Object.freeze(Object.defineProperty({__proto__:null,Default:d,__namedExportsOrder:Q,default:J},Symbol.toStringTag,{value:"Module"}));export{d as D,te as F};
