fediversion/frontend/components/ui/avatar.tsx
fullsizemalt b4cddf41ea feat: Initialize Fediversion multi-band platform
- Fork elmeg-demo codebase for multi-band support
- Add data importer infrastructure with base class
- Create band-specific importers:
  - phish.py: Phish.net API v5
  - grateful_dead.py: Grateful Stats API
  - setlistfm.py: Dead & Company, Billy Strings (Setlist.fm)
- Add spec-kit configuration for Gemini
- Update README with supported bands and architecture
2025-12-28 12:39:28 -08:00

62 lines
1.7 KiB
TypeScript

"use client"
import * as React from "react"
import { cn } from "@/lib/utils"
interface AvatarProps extends React.HTMLAttributes<HTMLDivElement> { }
const Avatar = React.forwardRef<HTMLDivElement, AvatarProps>(
({ className, ...props }, ref) => (
<div
ref={ref}
className={cn(
"relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full",
className
)}
{...props}
/>
)
)
Avatar.displayName = "Avatar"
interface AvatarImageProps extends React.ImgHTMLAttributes<HTMLImageElement> { }
const AvatarImage = React.forwardRef<HTMLImageElement, AvatarImageProps>(
({ className, src, alt = "", ...props }, ref) => {
const [hasError, setHasError] = React.useState(false)
if (hasError || !src) {
return null
}
return (
<img
ref={ref}
src={src}
alt={alt}
onError={() => setHasError(true)}
className={cn("aspect-square h-full w-full object-cover", className)}
{...props}
/>
)
}
)
AvatarImage.displayName = "AvatarImage"
interface AvatarFallbackProps extends React.HTMLAttributes<HTMLDivElement> { }
const AvatarFallback = React.forwardRef<HTMLDivElement, AvatarFallbackProps>(
({ className, ...props }, ref) => (
<div
ref={ref}
className={cn(
"flex h-full w-full items-center justify-center rounded-full bg-muted text-muted-foreground",
className
)}
{...props}
/>
)
)
AvatarFallback.displayName = "AvatarFallback"
export { Avatar, AvatarImage, AvatarFallback }