var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=MSelect;var _slicedToArray2=_interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));var _react=_interopRequireWildcard(require("react"));var _native=require("@react-navigation/native");var _reactNative=require("react-native");var _MButton=_interopRequireDefault(require("./MButton"));var _CommonStyles=require("../screens/CommonStyles");var _theme=require("../theme");var _icons=require("../assets/icons");var _MText=require("./MText");var _reactNativeSafeAreaContext=require("react-native-safe-area-context");var _jsxFileName="/Users/tima/Tima/react-native-timacare/src/components/MSelect.tsx";function _interopRequireWildcard(e,t){if("function"==typeof WeakMap)var r=new WeakMap(),n=new WeakMap();return(_interopRequireWildcard=function _interopRequireWildcard(e,t){if(!t&&e&&e.__esModule)return e;var o,i,f={__proto__:null,default:e};if(null===e||"object"!=typeof e&&"function"!=typeof e)return f;if(o=t?n:r){if(o.has(e))return o.get(e);o.set(e,f);}for(var _t in e)"default"!==_t&&{}.hasOwnProperty.call(e,_t)&&((i=(o=Object.defineProperty)&&Object.getOwnPropertyDescriptor(e,_t))&&(i.get||i.set)?o(f,_t,i):f[_t]=e[_t]);return f;})(e,t);}function MSelect(props){var _props$route,_props$route$params,_props$route2,_props$route2$params,_this=this;var insets=(0,_reactNativeSafeAreaContext.useSafeAreaInsets)();var navigation=(0,_native.useNavigation)();var _useState=(0,_react.useState)(props!=null&&(_props$route=props.route)!=null&&(_props$route$params=_props$route.params)!=null&&_props$route$params.data?props==null?void 0:(_props$route2=props.route)==null?void 0:(_props$route2$params=_props$route2.params)==null?void 0:_props$route2$params.data:[]),_useState2=(0,_slicedToArray2.default)(_useState,2),data=_useState2[0],setData=_useState2[1];return _react.default.createElement(_reactNative.View,{style:{flex:1,backgroundColor:'#FFFFFF'},__self:this,__source:{fileName:_jsxFileName,lineNumber:20,columnNumber:5}},_react.default.createElement(_reactNative.View,{style:{flex:1,marginTop:insets.top},__self:this,__source:{fileName:_jsxFileName,lineNumber:21,columnNumber:7}},_react.default.createElement(_reactNative.View,{style:[_CommonStyles.commonStyles.alignCenter,{alignItems:'center',marginTop:16}],__self:this,__source:{fileName:_jsxFileName,lineNumber:22,columnNumber:9}},_react.default.createElement(_MButton.default,{onPress:function onPress(){return navigation.goBack();},style:[{position:'absolute',left:16}],__self:this,__source:{fileName:_jsxFileName,lineNumber:28,columnNumber:11}},_react.default.createElement(_icons.IconBack,{fill:_theme.color.textHeader,__self:this,__source:{fileName:_jsxFileName,lineNumber:33,columnNumber:13}})),_react.default.createElement(_MText.MText,{style:[_CommonStyles.commonStyles.textNormalBold,{color:_theme.color.textHeader,fontSize:16}],__self:this,__source:{fileName:_jsxFileName,lineNumber:35,columnNumber:11}},props==null?void 0:props.route.params.title)),_react.default.createElement(_reactNative.View,{style:{backgroundColor:'#F2F3F5',height:1,marginTop:16},__self:this,__source:{fileName:_jsxFileName,lineNumber:44,columnNumber:9}}),_react.default.createElement(_reactNative.ScrollView,{style:{flex:1},__self:this,__source:{fileName:_jsxFileName,lineNumber:47,columnNumber:9}},data==null?void 0:data.map(function(item,index){return _react.default.createElement(_react.default.Fragment,null,_react.default.createElement(_reactNative.TouchableOpacity,{key:index,style:{padding:16,backgroundColor:'#FFFFFF'},onPress:function onPress(){var _props$route3,_props$route3$params;if(props!=null&&(_props$route3=props.route)!=null&&(_props$route3$params=_props$route3.params)!=null&&_props$route3$params.callback){var _props$route4,_props$route4$params;props==null?void 0:(_props$route4=props.route)==null?void 0:(_props$route4$params=_props$route4.params)==null?void 0:_props$route4$params.callback(item);navigation.goBack();}else{navigation.goBack();}},__self:_this,__source:{fileName:_jsxFileName,lineNumber:50,columnNumber:15}},_react.default.createElement(_MText.MText,{style:[{fontSize:16,fontWeight:'500',color:'#333333'}],__self:_this,__source:{fileName:_jsxFileName,lineNumber:65,columnNumber:17}},item==null?void 0:item.name)),_react.default.createElement(_reactNative.View,{style:{backgroundColor:'#F2F3F5',height:1},__self:_this,__source:{fileName:_jsxFileName,lineNumber:73,columnNumber:15}}));}))));}
//# sourceMappingURL=MSelect.js.map