mirror of
https://github.com/truewhile/MeBox.git
synced 2026-10-01 12:06:38 +08:00
refactor: split modules and harden scraping workflows
This commit is contained in:
@@ -1,28 +1,13 @@
|
||||
import { FormEvent, useState } from 'react'
|
||||
import { createRoot } from 'react-dom/client'
|
||||
import { LockKeyhole } from 'lucide-react'
|
||||
|
||||
type PinOptions = {
|
||||
export type PinOptions = {
|
||||
title?: string
|
||||
message?: string
|
||||
profileName: string
|
||||
}
|
||||
|
||||
export function requestPIN(options: PinOptions): Promise<string | null> {
|
||||
return new Promise((resolve) => {
|
||||
const host = document.createElement('div')
|
||||
document.body.appendChild(host)
|
||||
const root = createRoot(host)
|
||||
const close = (value: string | null) => {
|
||||
root.unmount()
|
||||
host.remove()
|
||||
resolve(value)
|
||||
}
|
||||
root.render(<PinDialog options={options} onClose={close} />)
|
||||
})
|
||||
}
|
||||
|
||||
function PinDialog({
|
||||
export function PinDialog({
|
||||
options,
|
||||
onClose,
|
||||
}: {
|
||||
|
||||
Reference in New Issue
Block a user