import { Section } from "./section" import { H2, Text } from "./text" import "hono/jsx" import type { FC, JSX } from "hono/jsx" import { VStack, HStack } from "./stack" export type AvatarProps = { src: string alt?: string size?: number rounded?: boolean style?: JSX.CSSProperties } export const Avatar: FC = (props) => { const { src, size = 32, rounded, style, alt = "" } = props const avatarStyle: JSX.CSSProperties = { width: `${size}px`, height: `${size}px`, borderRadius: rounded ? "9999px" : undefined, ...style, } return {alt} } export const Test = () => { const sampleImages = [ "https://picsum.photos/seed/3/200/200", "https://picsum.photos/seed/2/200/200", "https://picsum.photos/seed/8/200/200", "https://picsum.photos/seed/9/200/200", ] return (
{/* API Usage Examples */}
<Avatar src="/user.jpg" />
<Avatar src="/user.jpg" size={64} />
<Avatar src="/user.jpg" size={48} rounded />
<Avatar src="/user.jpg" style={{ border: "2px solid blue" }} />
{/* Size variations */}

Size Variations

{[24, 32, 48, 64, 96].map((size) => ( {size}x{size} ))}
{/* Rounded vs Square */}

Rounded vs Square

Square Rounded
{/* Different images */}

Different Images

{sampleImages.map((src, index) => ( Image {index + 1} ))}
{/* Custom styles */}

With Custom Styles

With Border With Shadow Border + Shadow
) }