import { useRosettaColors } from "@/app/hooks/useRosettaColors"; import { useDeviceResolve } from "@/app/providers/DeviceProvider/useDeviceResolve"; import { DeviceEntry } from "@/app/providers/ProtocolProvider/protocol/packets/packet.device.list"; import { Box, Button, Divider, Flex, Text } from "@mantine/core"; import { modals } from "@mantine/modals"; export interface DeviceVerifyProps { device: DeviceEntry; } export function DeviceVerify(props: DeviceVerifyProps) { const colors = useRosettaColors(); const { accept, decline } = useDeviceResolve(); const acceptConfirmModal = () => { modals.openConfirmModal({ title: 'Accept new device', children: ( Are you sure you want to accept this device? This will allow it to access your account. ), centered: true, labels: { confirm: 'Accept', cancel: 'Cancel' }, cancelProps: { color: 'gray', style: { outline: 'none' } }, onConfirm: () => accept(props.device.deviceId), }); } return ( New login from {props.device.deviceName} ({props.device.deviceOs}) ); }