"use client" import type React from "react" import { useState } from "react" import { useRouter } from "next/navigation" import { Button } from "@/components/ui/button" import { Input } from "@/components/ui/input" import { Textarea } from "@/components/ui/textarea" import { Label } from "@/components/ui/label" import { Card, CardContent, CardDescription, CardFooter, CardHeader, CardTitle } from "@/components/ui/card" import { ArrowLeft, Plus, Trash } from "lucide-react" import Link from "next/link" export default function NewProjectPage() { const router = useRouter() const [isSubmitting, setIsSubmitting] = useState(false) const [devices, setDevices] = useState([{ id: "1", name: "" }]) const handleAddDevice = () => { setDevices([...devices, { id: Date.now().toString(), name: "" }]) } const handleRemoveDevice = (id: string) => { setDevices(devices.filter((device) => device.id !== id)) } const handleDeviceChange = (id: string, value: string) => { setDevices(devices.map((device) => (device.id === id ? { ...device, name: value } : device))) } const handleSubmit = (e: React.FormEvent) => { e.preventDefault() setIsSubmitting(true) // Simulate API call setTimeout(() => { setIsSubmitting(false) router.push("/dashboard/projects") }, 1500) } return (

新建项目

项目基本信息 创建新项目需要填写项目名称并设置账号信息
{devices.map((device, index) => (
handleDeviceChange(device.id, e.target.value)} /> {devices.length > 1 && ( )}
))}