UNPKG

sccoreui

Version:

ui-sccore

20 lines (19 loc) 1.03 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.DropdownComponent = void 0; const jsx_runtime_1 = require("react/jsx-runtime"); const react_1 = require("react"); const dropdown_1 = require("primereact/dropdown"); const DropdownComponent = () => { const [selectedCity, setSelectedCity] = (0, react_1.useState)(null); const cities = [ { name: 'New York', code: 'NY' }, { name: 'Rome', code: 'RM' }, { name: 'London', code: 'LDN' }, { name: 'Istanbul', code: 'IST' }, { name: 'Paris', code: 'PRS' }, ]; return ((0, jsx_runtime_1.jsx)("div", Object.assign({ className: "card flex justify-content-center" }, { children: (0, jsx_runtime_1.jsx)(dropdown_1.Dropdown, { value: selectedCity, onChange: (e) => setSelectedCity(e.value), options: cities, optionLabel: "name", placeholder: "Select a City", className: "w-full md:w-14rem" }) }))); }; exports.DropdownComponent = DropdownComponent; exports.default = dropdown_1.Dropdown;