Initial commit: MOPC platform with Docker deployment setup

Full Next.js 15 platform with tRPC, Prisma, PostgreSQL, NextAuth.
Includes production Dockerfile (multi-stage, port 7600), docker-compose
with registry-based image pull, Gitea Actions CI workflow, nginx config
for portal.monaco-opc.com, deployment scripts, and DEPLOYMENT.md guide.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-30 13:41:32 +01:00
commit a606292aaa
290 changed files with 70691 additions and 0 deletions

View File

@@ -0,0 +1,87 @@
'use client'
import { useState, useEffect } from 'react'
import { Avatar, AvatarFallback, AvatarImage } from '@/components/ui/avatar'
import { cn, getInitials } from '@/lib/utils'
import { Camera } from 'lucide-react'
type UserAvatarProps = {
user: {
name?: string | null
email?: string | null
profileImageKey?: string | null
}
size?: 'xs' | 'sm' | 'md' | 'lg' | 'xl'
className?: string
showEditOverlay?: boolean
avatarUrl?: string | null
}
const sizeClasses = {
xs: 'h-6 w-6',
sm: 'h-8 w-8',
md: 'h-10 w-10',
lg: 'h-12 w-12',
xl: 'h-16 w-16',
}
const textSizeClasses = {
xs: 'text-[10px]',
sm: 'text-xs',
md: 'text-sm',
lg: 'text-base',
xl: 'text-lg',
}
const iconSizeClasses = {
xs: 'h-3 w-3',
sm: 'h-3 w-3',
md: 'h-4 w-4',
lg: 'h-5 w-5',
xl: 'h-6 w-6',
}
export function UserAvatar({
user,
size = 'md',
className,
showEditOverlay = false,
avatarUrl,
}: UserAvatarProps) {
const [imageError, setImageError] = useState(false)
const initials = getInitials(user.name || user.email || 'U')
// Reset error state when avatarUrl changes
useEffect(() => {
setImageError(false)
}, [avatarUrl])
return (
<div className={cn('relative group', className)}>
<Avatar className={cn(sizeClasses[size])}>
{avatarUrl && !imageError ? (
<AvatarImage
src={avatarUrl}
alt={user.name || 'User avatar'}
onError={() => setImageError(true)}
/>
) : null}
<AvatarFallback className={cn(textSizeClasses[size])}>
{initials}
</AvatarFallback>
</Avatar>
{showEditOverlay && (
<div
className={cn(
'absolute inset-0 flex items-center justify-center rounded-full',
'bg-black/50 opacity-0 group-hover:opacity-100 transition-opacity',
'cursor-pointer'
)}
>
<Camera className={cn('text-white', iconSizeClasses[size])} />
</div>
)}
</div>
)
}