feat: proper redirect handling

This commit is contained in:
2025-05-29 14:17:09 +02:00
parent 8364a8e9ec
commit 807d7538a0
10 changed files with 106 additions and 53 deletions

View File

@ -0,0 +1,30 @@
import { useAuth } from "@/store/auth";
import { User } from "lucide-react";
import type { FC } from "react";
export interface AvatarProps {
iconSize?: number;
className?: string;
}
const Avatar: FC<AvatarProps> = ({ iconSize = 32, className }) => {
const profile = useAuth((state) => state.profile);
return (
<div
className={`overflow-hidden bg-gray-100 rounded-full ring ring-gray-400 dark:ring dark:ring-gray-500 flex items-center justify-center ${className}`}
>
{profile?.profile_picture ? (
<img
src={profile?.profile_picture?.toString()}
className="w-full h-full flex-1 object-cover"
alt="profile"
/>
) : (
<User size={iconSize} />
)}
</div>
);
};
export default Avatar;