import { jsx as _jsx } from "react/jsx-runtime";
import { Icon } from "@powerhousedao/design-system";
import { Controller } from "react-hook-form";
import { ConnectSelect } from "../../select/select.js";
export function appToInputOption(app) {
    return {
        value: app.id,
        displayValue: app.name,
        icon: _jsx(Icon, { name: "PowerhouseLogoSmall" }),
        description: "Built by Powerhouse",
    };
}
export function AppFormInput(props) {
    const { control, appOptions, ...delegatedProps } = props;
    const items = appOptions.map(appToInputOption);
    return (_jsx(Controller, { control: control, name: "appId", render: ({ field }) => (_jsx(ConnectSelect, { ...delegatedProps, ...field, id: "appId", items: items })) }));
}
//# sourceMappingURL=app-form-input.js.map