mirror of
https://github.com/shadcn-ui/ui.git
synced 2026-07-02 17:08:39 +00:00
64 lines
1.5 KiB
TypeScript
64 lines
1.5 KiB
TypeScript
import * as React from "react"
|
|
import { PlusIcon } from "lucide-react"
|
|
|
|
import {
|
|
Avatar,
|
|
AvatarFallback,
|
|
AvatarImage,
|
|
} from "@/styles/base-nova/ui/avatar"
|
|
import { Button } from "@/styles/base-nova/ui/button"
|
|
import {
|
|
Item,
|
|
ItemActions,
|
|
ItemContent,
|
|
ItemDescription,
|
|
ItemGroup,
|
|
ItemMedia,
|
|
ItemSeparator,
|
|
ItemTitle,
|
|
} from "@/styles/base-nova/ui/item"
|
|
|
|
const people = [
|
|
{
|
|
username: "shadcn",
|
|
avatar: "https://github.com/shadcn.png",
|
|
email: "shadcn@vercel.com",
|
|
},
|
|
{
|
|
username: "maxleiter",
|
|
avatar: "https://github.com/maxleiter.png",
|
|
email: "maxleiter@vercel.com",
|
|
},
|
|
{
|
|
username: "evilrabbit",
|
|
avatar: "https://github.com/evilrabbit.png",
|
|
email: "evilrabbit@vercel.com",
|
|
},
|
|
]
|
|
|
|
export function ItemGroupExample() {
|
|
return (
|
|
<ItemGroup className="max-w-sm">
|
|
{people.map((person, index) => (
|
|
<Item key={person.username} variant="outline">
|
|
<ItemMedia>
|
|
<Avatar>
|
|
<AvatarImage src={person.avatar} className="grayscale" />
|
|
<AvatarFallback>{person.username.charAt(0)}</AvatarFallback>
|
|
</Avatar>
|
|
</ItemMedia>
|
|
<ItemContent className="gap-1">
|
|
<ItemTitle>{person.username}</ItemTitle>
|
|
<ItemDescription>{person.email}</ItemDescription>
|
|
</ItemContent>
|
|
<ItemActions>
|
|
<Button variant="ghost" size="icon" className="rounded-full">
|
|
<PlusIcon />
|
|
</Button>
|
|
</ItemActions>
|
|
</Item>
|
|
))}
|
|
</ItemGroup>
|
|
)
|
|
}
|