{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "account-avatar-upload-01", "type": "registry:block", "description": "Profile avatar upload and management", "registryDependencies": [ "button", "card" ], "files": [ { "path": "creative-tim-ui/blocks/account-avatar-upload-01/page.tsx", "content": "\"use client\"\n\nimport * as React from \"react\"\nimport {\n CheckCircle2,\n Pencil,\n Trash2,\n Upload,\n User,\n XCircle,\n} from \"lucide-react\"\n\nimport {\n Avatar,\n AvatarFallback,\n AvatarImage,\n} from \"@/components/ui/avatar\"\nimport { Button } from \"@/components/ui/button\"\nimport { Card } from \"@/components/ui/card\"\nimport { Label } from \"@/components/ui/label\"\nimport { Switch } from \"@/components/ui/switch\"\n\nexport default function AccountAvatarUpload01() {\n const [status, setStatus] = React.useState(\"Online\")\n const [avatarPreview, setAvatarPreview] = React.useState(null)\n\n const handleFileUpload = (event: React.ChangeEvent) => {\n const file = event.target.files?.[0]\n if (file) {\n const reader = new FileReader()\n reader.onloadend = () => {\n setAvatarPreview(reader.result as string)\n }\n reader.readAsDataURL(file)\n }\n }\n\n const handleRemoveAvatar = () => {\n setAvatarPreview(null)\n }\n\n return (\n
\n \n
\n
\n
\n \n
\n
\n

\n Profile Picture\n

\n

\n Update your profile picture and personal information\n

\n
\n
\n
\n\n
\n
\n
\n
\n \n \n \n \n \n \n \n
\n \n
\n \n \n
\n\n
\n

Select and Upload Image

\n

\n .svg, .png, .jpg (size 400x400px)\n

\n
\n
\n\n
\n \n {avatarPreview && (\n \n )}\n
\n
\n\n
\n \n
\n \n setStatus((cur) => (cur === \"Online\" ? \"Offline\" : \"Online\"))\n }\n />\n \n {status === \"Online\" ? (\n \n ) : (\n \n )}\n {status}\n \n
\n
\n
\n\n
\n
\n \n
\n

Profile Picture Tips

\n

\n Choose a high-quality, professional image that clearly shows\n your face. Recommended image size is 400x400 pixels. Only .svg,\n .png, and .jpg formats are supported.\n

\n
\n
\n
\n
\n
\n )\n}\n", "type": "registry:page", "target": "app/account-avatar-upload/page.tsx" } ], "meta": { "iframeHeight": "600px", "container": "w-full bg-surface min-h-svh flex px-4 py-12 items-center md:py-20 justify-center min-w-0", "mobile": "component" }, "categories": [ "account" ] }