UNPKG

@tsc_tech/medusa-plugin-notification-template

Version:
30 lines (29 loc) 959 B
import { jsxs, jsx } from "react/jsx-runtime"; import { Select } from "@medusajs/ui"; const EventSelect = ({ onChange, value, setTags, eventList, ...props }) => { return /* @__PURE__ */ jsxs( Select, { onValueChange: (v) => { var _a; onChange(v); if (setTags) { setTags((_a = eventList == null ? void 0 : eventList.find((item) => (item == null ? void 0 : item.name) === v)) == null ? void 0 : _a.tags); } }, children: [ /* @__PURE__ */ jsx(Select.Trigger, { children: /* @__PURE__ */ jsx(Select.Value, { placeholder: `Select an Event` }) }), /* @__PURE__ */ jsx(Select.Content, { children: eventList == null ? void 0 : eventList.map((item) => /* @__PURE__ */ jsx(Select.Item, { value: item == null ? void 0 : item.name, children: item == null ? void 0 : item.name }, item == null ? void 0 : item.id)) }) ] } ); }; export { EventSelect as default };