(window.saladictEntry=window.saladictEntry||[]).push([[142],{657:function(e,t,a){"use strict";a.r(t),a.d(t,"DictRenren",(function(){return s}));var n=a(0),c=a.n(n),l=a(119),r=a(1);const i=({slide:e})=>{const[t,a]=Object(n.useState)(240),[r,i]=Object(n.useState)(!1);return Object(n.useEffect)(()=>{i(!1)},[e.cover]),c.a.createElement("div",{className:"dictRenren-Slide"},c.a.createElement("div",{className:"dictRenren-Slide_Speaker"},c.a.createElement(l.c,{src:e.mp3,width:20})),c.a.createElement("figure",{style:{height:t}},c.a.createElement("img",{src:e.cover,alt:e.en,className:"dictRenren-Slide_Cover"+(r?" isLoaded":""),onLoad:e=>{a(e.currentTarget.height),i(!0)}}),c.a.createElement("figcaption",null,c.a.createElement("p",{dangerouslySetInnerHTML:{__html:e.en},className:"dictRenren-Slide_En"}),c.a.createElement("p",{className:"dictRenren-Slide_Chs"},e.chs))))},s=({result:e})=>{const[t,a]=Object(n.useState)(0),[l,s]=Object(n.useState)({});Object(n.useEffect)(()=>{a(0)},[e]);return c.a.createElement(c.a.Fragment,null,c.a.createElement("select",{onChange:e=>a(Number(e.currentTarget.value)||0),value:t},e.map((e,t)=>c.a.createElement("option",{key:e.key,value:t},e.title))),l[e[t].key]?l[e[t].key].map(e=>c.a.createElement(i,{key:e.cover+e.mp3,slide:e})):c.a.createElement(c.a.Fragment,null,c.a.createElement(i,{slide:e[t].slide}),c.a.createElement("a",{className:"dictRenren-Detail",href:e[t].detail,onClick:async a=>{a.preventDefault(),a.stopPropagation();const n=e[t],c=await r.a.send({type:"DICT_ENGINE_METHOD",payload:{id:"renren",method:"getDetail",args:[n.detail]}});c&&c.length>0&&s(e=>({...e,[n.key]:c}))}},"⤋查看详情"),e[t].context.map(e=>c.a.createElement("div",{key:e.title,className:"dictRenren-Ctx"},c.a.createElement("p",{className:"dictRenren-Ctx_Title"},e.title),c.a.createElement("div",{className:"dictRenren-Ctx_Subtitles"},e.content.map(e=>c.a.createElement("p",{key:e},e)))))))};t.default=s}}]);