import{j as e}from"./assertThisInitialized-ClXgY4BW.js";import{a as d}from"./dataProvider-BSMCbdJg.js";import{G as c}from"./api-D469Uxm1.js";import{r as l}from"./ideExtension-Duoj5XVI.js";import{u as p}from"./useGetOne-Ddk2GsYy.js";import{L as u}from"./RefreshIconButton-Y4b9u9mV.js";import{T as f}from"./TextField-n0Myx-gm.js";import{B as x}from"./Button-C3j8Wgdd.js";import{A as g}from"./AdminContext-jMMnnv4u.js";import{d as h}from"./defaultI18nProvider-C_r1y4tu.js";import"./index-BP8_t0zE.js";import"./useQuery-DJhJ3Hj4.js";import"./useLogout-DAYYFX4P.js";import"./useDataProvider-BTi1EEZL.js";import"./useRefresh-BVYjI9Ho.js";import"./CircularProgress-CoZCnRya.js";import"./createSvgIcon-BeVLBbd8.js";import"./createSvgIcon-C1LdFc73.js";import"./Typography-E7d16C50.js";import"./useRecordContext-CmNI-aHo.js";import"./PreferencesEditorContext-oPOmBo-a.js";import"./index-qEiLzbkV.js";import"./index-BCKAMao3.js";const z={title:"DataProvider/UseGetOne",parameters:{layout:"centered"},decorators:[r=>j(r)]},t={render:()=>{let{data:r,isLoading:o,isRefetching:n,refetch:m}=p(l("users",{allowContext:!1}),{id:1});return e.jsxs(c.Exclude,{children:[o||n?e.jsx(u,{}):e.jsx(f,{record:r,source:"name"}),!o&&e.jsx(x,{label:"Reload",onClick:()=>m()})]})}},j=r=>e.jsx(g,{dataProvider:d,i18nProvider:h,children:e.jsx(r,{})});var a,i,s;t.parameters={...t.parameters,docs:{...(a=t.parameters)==null?void 0:a.docs,source:{originalSource:`{
  render: () => {
    let {
      data,
      isLoading,
      isRefetching,
      refetch
    } = useGetOne(resourceName('users', {
      allowContext: false
    }), {
      id: 1
    });
    return <GenerationInstructions.Exclude>
          {isLoading || isRefetching ? <LoadingIndicator /> : <TextField record={data} source="name" />}
          {!isLoading && <Button label="Reload" onClick={() => refetch()} />}
    </GenerationInstructions.Exclude>;
  }
}`,...(s=(i=t.parameters)==null?void 0:i.docs)==null?void 0:s.source}}};const H=["Default"];export{t as Default,H as __namedExportsOrder,z as default};
