import { importShared } from './__federation_fn_import-BY6M5C84.js';
import { j as jsxRuntimeExports } from './jsx-runtime-XI9uIe3W.js';
/* empty css                */

const {useProjectDefinition} = await importShared('@baseplate-dev/project-builder-lib/web');

const {SelectFieldController} = await importShared('@baseplate-dev/ui-components');

function AdminCrudFileInputForm({
  formProps,
  name,
  model
}) {
  const { definitionContainer } = useProjectDefinition();
  const fileTransformerOptions = model.service.transformers.filter((t) => t.type === "file").map((transformer) => ({
    label: definitionContainer.nameFromId(transformer.fileRelationRef),
    value: transformer.id
  }));
  const prefix = name;
  const controlTyped = formProps.control;
  return /* @__PURE__ */ jsxRuntimeExports.jsx(
    SelectFieldController,
    {
      label: "File Transformer Name",
      control: controlTyped,
      name: `${prefix}.modelRelationRef`,
      options: fileTransformerOptions
    }
  );
}

const {createPlatformPluginExport} = await importShared('@baseplate-dev/project-builder-lib');

const {adminCrudInputWebSpec} = await importShared('@baseplate-dev/project-builder-lib/web');
const web = createPlatformPluginExport({
  dependencies: {
    adminCrudInputWeb: adminCrudInputWebSpec
  },
  exports: {},
  initialize: ({ adminCrudInputWeb }, { pluginKey }) => {
    adminCrudInputWeb.registerInputWebConfig({
      name: "file",
      pluginKey,
      label: "File",
      getNewInput: () => ({ label: "", type: "file", modelRelationRef: "" }),
      Form: AdminCrudFileInputForm
    });
    return {};
  }
});

export { web as default };
//# sourceMappingURL=__federation_expose_storageAdmin-crudWeb-C93Dddcy.js.map
