diff --git a/src/lib/utils/dropdownOptionsGenerator.js b/src/lib/utils/dropdownOptionsGenerator.js new file mode 100644 index 00000000..c719fac9 --- /dev/null +++ b/src/lib/utils/dropdownOptionsGenerator.js @@ -0,0 +1,25 @@ +// This file is part of React-Invenio-Forms +// Copyright (C) 2024 CERN. +// +// React-Invenio-Forms is free software; you can redistribute it and/or modify it +// under the terms of the MIT License; see LICENSE file for more details. + +import React from "react"; + +export function dropdownOptionsGenerator(dropdownOptions) { + return dropdownOptions.map((options) => { + return { + key: options.key, + text: options.text, + value: options.key, + content: ( + <> +