(this["webpackJsonpbeancount-web"]=this["webpackJsonpbeancount-web"]||[]).push([[19],{188:function(e,t,n){"use strict";var r=n(0),a=n(5);t.a=e=>class extends r.Component{constructor(){super(...arguments),this.defaultCommodity={currency:"CNY",symbol:"\uffe5"},this.currentCommodity=window.localStorage.getItem("ledgerCurrency")}render(){return Object(a.jsx)(e,{...this.props,commodity:this.currentCommodity?JSON.parse(this.currentCommodity):this.defaultCommodity})}}},215:function(e,t,n){"use strict";var r=n(4),a=n(0),i=n(113);t.a=function(){var e=a.useState(!1),t=Object(r.a)(e,2),n=t[0],o=t[1];return a.useEffect((function(){o(Object(i.b)())}),[]),n}},326:function(e,t,n){"use strict";n.d(t,"a",(function(){return b}));var r=n(3),a=n(1),i=n(4),o=n(10),c=n.n(o),l=n(69),s=n(0),d=n(42),u=n(215);function p(e){var t=e.className,n=e.direction,i=e.index,o=e.marginDirection,c=e.children,l=e.split,d=e.wrap,u=s.useContext(b),p=u.horizontalSize,m=u.verticalSize,h=u.latestIndex,g={};return u.supportFlexGap||("vertical"===n?i{a.a.confirm({title:`\u786e\u8ba4\u5220\u9664${this.ledgerTitle}\uff1f`,icon:Object(p.jsx)(r.a,{}),content:"\u5220\u9664\u540e\u5c06\u4e0d\u80fd\u6062\u590d",okText:"\u5220\u9664",onOk:this.handleDelete,okButtonProps:{danger:!0},cancelText:"\u53d6\u6d88"})},this.handleDelete=()=>{this.setState({loading:!0}),Object(s.d)("/api/auth/ledger",{method:"DELETE"}).then((()=>{localStorage.clear(),i.b.success(`${this.ledgerTitle}\u5df2\u5220\u9664`),this.props.history.replace("/ledger")})).finally((()=>{this.setState({loading:!1})}))}}render(){return this.context.theme!==this.theme&&(this.theme=this.context.theme),Object(p.jsx)("div",{className:"setting-page",children:Object(p.jsx)(o.b,{direction:"vertical",size:"middle",style:{display:"flex"},children:Object(p.jsx)(c.a,{block:!0,danger:!0,loading:this.state.loading,onClick:this.handleOpenDeleteModal,children:"\u5220\u9664\u8d26\u672c"})})})}}m.contextType=d.a,t.default=Object(u.a)(m)}}]);