UNPKG

@particle-network/authkit

Version:

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

97 lines (96 loc) 5.42 kB
"use client"; import{a as x}from"./chunk-UIQ3FCLV.mjs";import{c as v}from"./chunk-DLTLN62L.mjs";import{a as u}from"./chunk-PPJQVDG4.mjs";import{M as f,h as p,ra as g,ta as b,wa as h}from"./chunk-WAC3ZEJ3.mjs";import"./chunk-2FKLQE76.mjs";import{deleteAuthorizationDApp as T}from"@particle-network/auth-core";import l from"antd/es/button";import A from"antd/es/modal";import e,{useState as w}from"react";var N=`.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 L=y=>{var n,r,m,c;let{loginDeviceInfo:t}=y,{t:i}=h(),_=b(),{authCoreModal:k}=g(),[M,d]=w(!1),[C,s]=w(!1),B=()=>{d(!0)},j=f(),o=()=>{d(!1)};return e.createElement("div",{className:"device-details-wrapper"},e.createElement("style",null,p(N)),e.createElement("div",{className:"device-details-container"},e.createElement(x,{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:()=>{B()}},i("new.delete_access"))),e.createElement(A,{className:"delete-confirm-modal",open:M,closable:!1,footer:null,centered:!0,getContainer:()=>k.rootBody},e.createElement("div",{className:"content-wrap"},e.createElement("div",{className:"close-btn",onClick:()=>{o()}},e.createElement(v,{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:C,onClick:()=>{s(!0),setTimeout(()=>{T(t==null?void 0:t.project_app_uuid).finally(()=>{s(!1)}).then(a=>{a&&(o(),setTimeout(()=>{_(-1)},500))}).catch(a=>{j.error(a.message)})},500)}},i("new.delete"))))),e.createElement(u,{className:"footer-box-v2"})))},U=L;export{U as default};