'use strict';
import { jsx } from 'react/jsx-runtime';
import { View } from '../../../meta/view/View.js';
import { isUuidSet } from '../../../../fd-toolbox/functions/value-checking-functions.js';
import { getViewPageResourcesMetas, getViewPageResourceListResources } from './ViewPage.funcs.js';

var __defProp = Object.defineProperty;
var __name = (target, value) => __defProp(target, "name", {
  value,
  configurable: true
});
async function ViewPage({
  id,
  name,
  resource
}) {
  const resourceId = id && isUuidSet(id) ? id : void 0;
  let uiResourceMetasPromise;
  let resourcesPromise;
  uiResourceMetasPromise = getViewPageResourcesMetas(resource);
  resourcesPromise = getViewPageResourceListResources(resource, uiResourceMetasPromise);
  return /* @__PURE__ */jsx("main", {
    className: "h-full py-4 pl-6",
    children: /* @__PURE__ */jsx(View, {
      resourceName: resource ?? "",
      resourceId,
      viewName: name,
      resources: resourcesPromise,
      uiResourceMetas: uiResourceMetasPromise
    })
  });
}
__name(ViewPage, "ViewPage");

export { ViewPage as default };
