87 lines
1.9 KiB
Text
87 lines
1.9 KiB
Text
---
|
|
import { Avatar, AvatarImage } from "@/components/ui/avatar"
|
|
import { Button } from "@/components/ui/button"
|
|
import { Icon } from "@/components/ui/icon"
|
|
import { Image } from "@/components/ui/image"
|
|
import {
|
|
Item,
|
|
ItemContent,
|
|
ItemDescription,
|
|
ItemMedia,
|
|
} from "@/components/ui/item"
|
|
import { Rating } from "@/components/ui/rating"
|
|
import {
|
|
Section,
|
|
SectionActions,
|
|
SectionContent,
|
|
SectionMedia,
|
|
SectionProse,
|
|
} from "@/components/ui/section"
|
|
|
|
interface Props {
|
|
class?: string
|
|
id?: string
|
|
item?: {
|
|
images?: {
|
|
src: string
|
|
alt: string
|
|
}[]
|
|
rating?: number
|
|
description?: string
|
|
}
|
|
links?: {
|
|
text?: string
|
|
href?: string
|
|
icon?: string
|
|
target?: string
|
|
}[]
|
|
image?: {
|
|
src: string
|
|
alt: string
|
|
}
|
|
}
|
|
|
|
const { class: className, id, item, links, image } = Astro.props
|
|
---
|
|
|
|
<Section class={className} id={id}>
|
|
<SectionContent class="items-center">
|
|
<Item class="p-0">
|
|
<ItemMedia class="-space-x-5">
|
|
{
|
|
item?.images?.map((image) => (
|
|
<Avatar class="ring-background size-11 ring">
|
|
<AvatarImage {...image} />
|
|
</Avatar>
|
|
))
|
|
}
|
|
</ItemMedia>
|
|
<ItemContent class="mt-1">
|
|
<Rating rating={item?.rating} />
|
|
<ItemDescription>
|
|
{item?.description}
|
|
</ItemDescription>
|
|
</ItemContent>
|
|
</Item>
|
|
<SectionProse class="text-center text-balance" size="lg">
|
|
<slot />
|
|
</SectionProse>
|
|
<SectionActions class="justify-center">
|
|
{
|
|
links?.map(({ icon, text, ...link }, i) => (
|
|
<Button
|
|
variant={i === 0 ? "default" : "secondary"}
|
|
size="lg"
|
|
{...link}
|
|
>
|
|
{icon && <Icon name={icon} />}
|
|
{text}
|
|
</Button>
|
|
))
|
|
}
|
|
</SectionActions>
|
|
</SectionContent>
|
|
<SectionMedia>
|
|
<Image sizes="(min-width: 1536px) 1536px, 100vw" priority {...image} />
|
|
</SectionMedia>
|
|
</Section>
|