'use client' import { useState } from 'react' import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Label } from "@/components/ui/label" import { Table, TableBody, TableCell, TableHead, TableHeader, TableRow } from "@/components/ui/table" import { Loader2, RefreshCw } from "lucide-react" type EnrollmentToken = { id: string token: string model: string timestamp: string } export default function EnrollmentTokenGenerator() { const [tokens, setTokens] = useState([]) const [isGenerating, setIsGenerating] = useState(false) const [quantity, setQuantity] = useState(1) const [model, setModel] = useState('iPhone 13') const generateToken = () => { return Math.random().toString(36).substr(2, 10).toUpperCase() } const handleGenerate = () => { setIsGenerating(true) const newTokens: EnrollmentToken[] = [] for (let i = 0; i < quantity; i++) { setTimeout(() => { const newToken: EnrollmentToken = { id: `TKN-${Date.now()}-${i}`, token: generateToken(), model: model, timestamp: new Date().toISOString() } newTokens.push(newToken) setTokens(prevTokens => [...prevTokens, newToken]) if (i === quantity - 1) { setIsGenerating(false) } }, i * 500) // Simulate delay in token generation } } return (

iPhone Enrollment Token Generator

setQuantity(parseInt(e.target.value))} />
setModel(e.target.value)} />
Token ID Enrollment Token iPhone Model Timestamp {tokens.map((token) => ( {token.id} {token.token} {token.model} {new Date(token.timestamp).toLocaleString()} ))}
) }