@particle-network/authkit
Version:
Auth Core provides MPC (Multi-Party Computation)-based threshold signatures.
97 lines (96 loc) • 5.31 kB
JavaScript
"use client";
import{a as b}from"./chunk-YAWI32JU.mjs";import{a as o,j as x}from"./chunk-NSWCC5PG.mjs";import"./chunk-BM7ICTT2.mjs";import{a as g}from"./chunk-ZTTU2K7E.mjs";import"./chunk-UXH6IVHO.mjs";import"./chunk-GYYKKPHD.mjs";import"./chunk-3RRPQ2DX.mjs";import{V as h,h as p,m as v,o as u,r as f}from"./chunk-H6TXMQRA.mjs";import"./chunk-C7OWFSST.mjs";import{deleteAuthorizationDApp as z}from"@particle-network/auth-core";import e,{useState as N}from"react";var w=`.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 {
padding: 24px;
}
.delete-confirm-modal .p-modal-confirm-btns {
display: none;
}
.delete-confirm-modal .p-modal-confirm-content {
margin: 0 !important;
}
.delete-confirm-modal .p-modal-body {
position: relative;
}
.delete-confirm-modal .content-text {
padding: 16px 0px;
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 .p-modal {
max-width: calc(100vw - 36px);
margin: 8px auto;
}
}
`;var T=y=>{var r,n,m,c;let{loginDeviceInfo:t}=y,{t:i}=f(),_=u(),{authCoreModal:k}=v(),[M,l]=N(!1),[C,s]=N(!1),P=()=>{l(!0)},B=h(),a=()=>{l(!1)};return e.createElement("div",{className:"device-details-wrapper"},e.createElement("style",null,p(w)),e.createElement("div",{className:"device-details-container"},e.createElement(b,{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"},((r=t==null?void 0:t.location)==null?void 0:r.ip)||"-")),e.createElement("div",{className:"item"},e.createElement("div",{className:"left"},i("new.country")),e.createElement("div",{className:"right"},((n=t==null?void 0:t.location)==null?void 0:n.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(o,{className:"still-confirm confirm-delete-btn",disabled:t.isCurrent,onClick:()=>{P()}},i("new.delete_access"))),e.createElement(x,{className:"delete-confirm-modal",open:M,closable:!0,footer:null,forceBottom:!0,height:"auto",getContainer:()=>k.rootBody,onCancel:a},e.createElement("div",{className:"content-wrap"},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(o,{className:"cancel-btn",onClick:()=>{a()}},i("common.cancel")),e.createElement(o,{className:"still-confirm delete-btn",loading:C,onClick:()=>{s(!0),setTimeout(()=>{z(t==null?void 0:t.project_app_uuid).finally(()=>{s(!1)}).then(d=>{d&&(a(),setTimeout(()=>{_(-1)},500))}).catch(d=>{B.error(d.message)})},500)}},i("new.delete"))))),e.createElement(g,{className:"footer-box-v2"})))},K=T;export{K as default};