hosted/ifttt-src/src/components/blocks/videos-2.astro

66 lines
1.4 KiB
Text

---
import { Button } from "@/components/ui/button"
import { Icon } from "@/components/ui/icon"
import {
Section,
SectionActions,
SectionContent,
SectionGrid,
SectionProse,
SectionSplit,
} from "@/components/ui/section"
import { Tile, TileContent, TileMedia, TileTitle } from "@/components/ui/tile"
import { Video } from "@/components/ui/video"
interface Props {
class?: string
id?: string
links?: {
icon?: string
text?: string
href?: string
target?: string
}[]
items?: {
href?: string
title?: string
video?: string
}[]
}
const { class: className, id, links, items } = Astro.props
---
<Section class={className} id={id}>
<SectionSplit>
<SectionContent>
<SectionProse>
<slot />
</SectionProse>
<SectionActions>
{
links?.map(({ icon, text, ...link }, i) => (
<Button variant={i === 0 ? "default" : "outline"} {...link}>
{icon && <Icon name={icon} />}
{text}
</Button>
))
}
</SectionActions>
</SectionContent>
<SectionGrid>
{
items?.map(({ href, title, video }) => (
<Tile href={href}>
<TileMedia>
<Video src={video} />
</TileMedia>
<TileContent>
<TileTitle>{title}</TileTitle>
</TileContent>
</Tile>
))
}
</SectionGrid>
</SectionSplit>
</Section>