{"ast":null,"code":"var _jsxFileName = \"/Users/adamsarli/Coding/student-agendas-fullstack/client/src/components/klasses/ShowKlassRouter.js\";\nimport React, { Component } from 'react';\nimport { addStudents } from '../../actions/studentActions';\nimport ShowKlassContainer from './ShowKlassContainer';\nimport { connect } from 'react-redux';\nimport { Route, Switch, Redirect } from \"react-router-dom\";\n\nclass ShowKlassRouter extends Component {\n  componentDidMount() {\n    const _this$props = this.props,\n          match = _this$props.match,\n          fetchStudents = _this$props.fetchStudents;\n    const klassId = match.params.id;\n    fetchStudents(klassId);\n  }\n\n  render() {\n    const match = this.props.match;\n    return React.createElement(\"div\", {\n      __source: {\n        fileName: _jsxFileName,\n        lineNumber: 18\n      },\n      __self: this\n    }, React.createElement(Switch, {\n      __source: {\n        fileName: _jsxFileName,\n        lineNumber: 19\n      },\n      __self: this\n    }, React.createElement(Route, {\n      exact: true,\n      path: \"\".concat(match.url),\n      component: ShowKlassContainer,\n      __source: {\n        fileName: _jsxFileName,\n        lineNumber: 20\n      },\n      __self: this\n    })));\n  }\n\n}\n\nfunction mapDispatchToProps(dispatch) {\n  return {\n    fetchStudents: klassId => dispatch(addStudents(klassId))\n  };\n}\n\nfunction mapStateToProps(state) {\n  return {\n    klasses: state.klasses\n  };\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ShowKlassRouter);","map":{"version":3,"sources":["/Users/adamsarli/Coding/student-agendas-fullstack/client/src/components/klasses/ShowKlassRouter.js"],"names":["React","Component","addStudents","ShowKlassContainer","connect","Route","Switch","Redirect","ShowKlassRouter","componentDidMount","props","match","fetchStudents","klassId","params","id","render","url","mapDispatchToProps","dispatch","mapStateToProps","state","klasses"],"mappings":";AAAA,OAAOA,KAAP,IAAgBC,SAAhB,QAAiC,OAAjC;AACA,SAASC,WAAT,QAA4B,8BAA5B;AACA,OAAOC,kBAAP,MAA+B,sBAA/B;AACA,SAASC,OAAT,QAAwB,aAAxB;AACA,SAASC,KAAT,EAAgBC,MAAhB,EAAwBC,QAAxB,QAAwC,kBAAxC;;AAGA,MAAMC,eAAN,SAA8BP,SAA9B,CAAwC;AACtCQ,EAAAA,iBAAiB,GAAE;AAAA,wBACgB,KAAKC,KADrB;AAAA,UACTC,KADS,eACTA,KADS;AAAA,UACFC,aADE,eACFA,aADE;AAEjB,UAAMC,OAAO,GAAGF,KAAK,CAACG,MAAN,CAAaC,EAA7B;AACAH,IAAAA,aAAa,CAACC,OAAD,CAAb;AACD;;AAEDG,EAAAA,MAAM,GAAE;AAAA,UACEL,KADF,GACY,KAAKD,KADjB,CACEC,KADF;AAEN,WACE;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OACE,oBAAC,MAAD;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,OACE,oBAAC,KAAD;AAAO,MAAA,KAAK,MAAZ;AAAa,MAAA,IAAI,YAAKA,KAAK,CAACM,GAAX,CAAjB;AAAmC,MAAA,SAAS,EAAEd,kBAA9C;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,MADF,CADF,CADF;AAOD;;AAhBqC;;AAmBxC,SAASe,kBAAT,CAA4BC,QAA5B,EAAqC;AACnC,SAAO;AACLP,IAAAA,aAAa,EAAGC,OAAD,IAAaM,QAAQ,CAACjB,WAAW,CAACW,OAAD,CAAZ;AAD/B,GAAP;AAGD;;AAED,SAASO,eAAT,CAAyBC,KAAzB,EAA+B;AAC7B,SAAO;AACLC,IAAAA,OAAO,EAAED,KAAK,CAACC;AADV,GAAP;AAGD;;AAED,eAAelB,OAAO,CAACgB,eAAD,EAAkBF,kBAAlB,CAAP,CAA6CV,eAA7C,CAAf","sourcesContent":["import React, { Component } from 'react'\nimport { addStudents } from '../../actions/studentActions'\nimport ShowKlassContainer from './ShowKlassContainer'\nimport { connect } from 'react-redux'\nimport { Route, Switch, Redirect } from \"react-router-dom\"\n\n\nclass ShowKlassRouter extends Component {\n  componentDidMount(){\n    const { match, fetchStudents } = this.props\n    const klassId = match.params.id\n    fetchStudents(klassId)\n  }\n\n  render(){\n    const { match } = this.props\n    return (\n      <div>\n        <Switch>\n          <Route exact path={`${match.url}`} component={ShowKlassContainer}/>\n        </Switch>\n      </div>\n    )\n  }\n}\n\nfunction mapDispatchToProps(dispatch){\n  return {\n    fetchStudents: (klassId) => dispatch(addStudents(klassId))\n  }\n}\n\nfunction mapStateToProps(state){\n  return {\n    klasses: state.klasses\n  }\n}\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ShowKlassRouter)\n"]},"metadata":{},"sourceType":"module"}