@particle-network/authkit
Version:
Auth Core provides MPC (Multi-Party Computation)-based threshold signatures.
97 lines (96 loc) • 5.39 kB
JavaScript
"use client";
import{a as u}from"./chunk-OZGUXGJL.mjs";import{b as p}from"./chunk-IOEQ3TXF.mjs";import{a as f}from"./chunk-OVV6E33Q.mjs";import{F as v,qa as x,sa as b,va as g}from"./chunk-6YEBFRI3.mjs";import"./chunk-2FKLQE76.mjs";import{deleteAuthorizationDApp as z}from"@particle-network/auth-core";import{Button as l,Modal as T}from"antd";import e,{useState as N}from"react";var h=`.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=w=>{var n,r,c,m;let{loginDeviceInfo:t}=w,{t:i}=g(),y=b(),{authCoreModal:_}=x(),[k,d]=N(!1),[M,s]=N(!1),C=()=>{d(!0)},B=v(),o=()=>{d(!1)};return e.createElement("div",{className:"device-details-wrapper"},e.createElement("style",null,h),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)||((c=t==null?void 0:t.location)==null?void 0:c.country_code)||"-")),e.createElement("div",{className:"item"},e.createElement("div",{className:"left"},i("new.city")),e.createElement("div",{className:"right"},((m=t==null?void 0:t.location)==null?void 0:m.city)||"-")))),e.createElement("div",{className:"btns"},e.createElement(l,{className:"still-confirm confirm-delete-btn",disabled:t.isCurrent,onClick:()=>{C()}},i("new.delete_access"))),e.createElement(T,{className:"delete-confirm-modal",open:k,closable:!1,footer:null,centered:!0,getContainer:()=>_.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:M,onClick:()=>{s(!0),setTimeout(()=>{z(t==null?void 0:t.project_app_uuid).finally(()=>{s(!1)}).then(a=>{a&&(o(),setTimeout(()=>{y(-1)},500))}).catch(a=>{B.error(a.message)})},500)}},i("new.delete"))))),e.createElement(f,{className:"footer-box-v2"})))},K=A;export{K as default};