Files
tonePage/tone-page-web/app/console/(with-menu)/user/components/user-info-editor.tsx
2025-05-12 10:27:50 +08:00

69 lines
2.2 KiB
TypeScript

'use client';
import * as React from "react"
import { cn } from "@/lib/utils"
import { Button } from "@/components/ui/button"
import {
Drawer,
DrawerClose,
DrawerContent,
DrawerDescription,
DrawerFooter,
DrawerHeader,
DrawerTitle,
} from "@/components/ui/drawer"
import { Input } from "@/components/ui/input"
import { Label } from "@/components/ui/label"
export function UserInfoEditor({
onClose,
userId,
}: {
onClose: () => void,
userId: string
}) {
return (
<Drawer open={!!userId} onClose={onClose} >
<DrawerContent>
<DrawerHeader className="text-left">
<DrawerTitle></DrawerTitle>
<DrawerDescription></DrawerDescription>
</DrawerHeader>
<ProfileForm className="px-4" />
<DrawerFooter className="pt-2">
<DrawerClose asChild>
<Button variant="outline"></Button>
</DrawerClose>
</DrawerFooter>
</DrawerContent>
</Drawer>
)
}
function ProfileForm({ className }: React.ComponentProps<"form">) {
return (
<form className={cn("grid items-start gap-4", className)}>
<div className="grid gap-2">
<Label htmlFor="email">UserId</Label>
<Input id="email" defaultValue="adijasiodjoi2q" disabled />
</div>
<div className="grid gap-2">
<Label htmlFor="username"></Label>
<Input id="username" defaultValue="username" />
</div>
<div className="grid gap-2">
<Label htmlFor="nickname"></Label>
<Input id="nickname" defaultValue="nickname" />
</div>
<div className="grid gap-2">
<Label htmlFor="email"></Label>
<Input id="email" defaultValue="email" />
</div>
<div className="grid gap-2">
<Label htmlFor="phone"></Label>
<Input id="phone" defaultValue="phone" />
</div>
<Button type="submit"></Button>
</form>
)
}