(props: ServerIconProps)
| 16 | }; |
| 17 | |
| 18 | export function ServerIcon(props: ServerIconProps) { |
| 19 | const { className, size = 64, ...rest } = props; |
| 20 | const serverIconUrl = makeServerIconLink(props.server, size); |
| 21 | return ( |
| 22 | <Avatar |
| 23 | {...props} |
| 24 | className={className} |
| 25 | style={{ |
| 26 | width: size, |
| 27 | height: size, |
| 28 | }} |
| 29 | {...rest} |
| 30 | > |
| 31 | <AvatarImage |
| 32 | src={serverIconUrl} |
| 33 | width={size} |
| 34 | height={size} |
| 35 | alt={props.server.name} |
| 36 | {...props} |
| 37 | /> |
| 38 | <AvatarFallback |
| 39 | {...props} |
| 40 | className={cn( |
| 41 | 'relative flex shrink-0 items-center justify-center overflow-hidden rounded-full bg-neutral-50 text-center dark:bg-neutral-700', |
| 42 | size > 64 ? 'text-4xl' : 'text-xl', |
| 43 | className, |
| 44 | )} |
| 45 | style={{ |
| 46 | width: size, |
| 47 | height: size, |
| 48 | }} |
| 49 | > |
| 50 | {getInitials(props.server.name)} |
| 51 | </AvatarFallback> |
| 52 | </Avatar> |
| 53 | ); |
| 54 | } |
nothing calls this directly
no test coverage detected