UNPKG

@particle-network/auth-core-modal

Version:

Auth Core provides MPC (Multi-Party Computation)-based threshold signatures.

97 lines (96 loc) 5.45 kB
"use client"; import{a as u}from"./chunk-CA2ONM6K.js";import{a as f}from"./chunk-3GNUKO34.js";import{b as p}from"./chunk-6ART4FPU.js";import{a as v}from"./chunk-JLTVTEXA.js";import{qa as x,sa as b}from"./chunk-CNYYVI6H.js";import"./chunk-L535NPP3.js";import{deleteAuthorizationDApp as j}from"@particle-network/auth-core";import{Button as l,Modal as z}from"antd";import e,{useState as h}from"react";import{useTranslation as T}from"react-i18next";var g=`.device-details-wrapper { -webkit-overflow-scrolling: touch; height: 100%; } .device-details-container { display: flex; flex-direction: column; width: 100%; height: 100%; overflow: auto; color: var(--text-color); } .device-details-container .scroll-wrapper { flex: 1; overflow: auto; } .device-details-container .details-list { padding: 0 18px; padding-bottom: 50px; margin-top: 20px; } .device-details-container .details-list .item { display: flex; justify-content: space-between; align-items: center; height: 58px; padding: 0 12px 0 14px; margin-bottom: 10px; border-radius: var(--card-border-radius); background: var(--card-unclickable-background-color); } .device-details-container .details-list .item .right { font-weight: 400; font-size: 12px; } .device-details-container .btns { display: flex; justify-content: center; align-items: center; width: 100%; padding: 0 18px; background: var(--theme-background-color); } .device-details-container .btns .confirm-delete-btn { width: 100%; max-width: 360px; height: 46px; padding: 0; line-height: 46px; } .delete-confirm-modal .ant-modal-confirm-btns, .delete-confirm-modal .anticon-exclamation-circle { display: none; } .delete-confirm-modal .ant-modal-confirm-content { margin: 0 !important; } .delete-confirm-modal .ant-modal-body { position: relative; padding: 26px 18px; } .delete-confirm-modal .content-text { margin-top: 40px; margin-bottom: 34px; font-weight: 500; font-size: 20px; text-align: center; color: var(--text-color); } .delete-confirm-modal .close-btn { position: absolute; top: 10px; right: 16px; font-size: 30px; } .delete-confirm-modal .btns { display: flex; gap: 20px; justify-content: space-between; } .delete-confirm-modal .btns button { flex: 1; height: 46px; } .delete-confirm-modal .btns button.cancel-btn { color: var(--text-color); background: var(--secondary-btn-background-color); } @media (max-width: 767px) { .delete-confirm-modal .ant-modal { max-width: calc(100vw - 36px); margin: 8px auto; } } `;var A=N=>{var n,r,m,c;let{loginDeviceInfo:t}=N,{t:i}=T(),w=b(),{authCoreModal:y}=x(),[_,d]=h(!1),[k,s]=h(!1),M=()=>{d(!0)},C=f(),o=()=>{d(!1)};return e.createElement("div",{className:"device-details-wrapper"},e.createElement("style",null,g),e.createElement("div",{className:"device-details-container"},e.createElement(u,{displayBackBtn:!0},i("new.details")),e.createElement("div",{className:"scroll-wrapper"},e.createElement("div",{className:"details-list"},e.createElement("div",{className:"item"},e.createElement("div",{className:"left"},i("new.app")),e.createElement("div",{className:"right"},t.project_app_name||"-")),e.createElement("div",{className:"item"},e.createElement("div",{className:"left"},i("new.device")),e.createElement("div",{className:"right"},t.device||"-")),e.createElement("div",{className:"item"},e.createElement("div",{className:"left"},i("new.authorized_time")),e.createElement("div",{className:"right"},t.updated_at||"-")),e.createElement("div",{className:"item"},e.createElement("div",{className:"left"},i("new.login_method")),e.createElement("div",{className:"right"},(t.login_channel||"-").replace("Twitterv1","Twitter"))),e.createElement("div",{className:"item"},e.createElement("div",{className:"left"},i("new.ip")),e.createElement("div",{className:"right"},((n=t==null?void 0:t.location)==null?void 0:n.ip)||"-")),e.createElement("div",{className:"item"},e.createElement("div",{className:"left"},i("new.country")),e.createElement("div",{className:"right"},((r=t==null?void 0:t.location)==null?void 0:r.country_name)||((m=t==null?void 0:t.location)==null?void 0:m.country_code)||"-")),e.createElement("div",{className:"item"},e.createElement("div",{className:"left"},i("new.city")),e.createElement("div",{className:"right"},((c=t==null?void 0:t.location)==null?void 0:c.city)||"-")))),e.createElement("div",{className:"btns"},e.createElement(l,{className:"still-confirm confirm-delete-btn",disabled:t.isCurrent,onClick:()=>{M()}},i("new.delete_access"))),e.createElement(z,{className:"delete-confirm-modal",open:_,closable:!1,footer:null,centered:!0,getContainer:()=>y.rootBody},e.createElement("div",{className:"content-wrap"},e.createElement("div",{className:"close-btn",onClick:()=>{o()}},e.createElement(p,{className:"circle_close",name:"circle_close"})),e.createElement("div",{className:"content-text"},i("new.delete_access_to_n").format(t==null?void 0:t.project_app_name,t==null?void 0:t.device)),e.createElement("div",{className:"btns"},e.createElement(l,{className:"cancel-btn",onClick:()=>{o()}},i("common.cancel")),e.createElement(l,{className:"still-confirm delete-btn",loading:k,onClick:()=>{s(!0),setTimeout(()=>{j(t==null?void 0:t.project_app_uuid).finally(()=>{s(!1)}).then(a=>{a&&(o(),setTimeout(()=>{w(-1)},500))}).catch(a=>{C.error(a.message)})},500)}},i("new.delete"))))),e.createElement(v,{className:"footer-box-v2"})))},O=A;export{O as default};