/** @jsxRuntime automatic */
/** @jsxImportSource remix/component */
import type { Action } from 'remix/router'
import { coverOf, featuredGalleries } from '../../src/domain/content.ts'
import { markdownToText } from '../../src/domain/markdown.ts'
import { canonicalUrl, loadSite } from '../data/site.ts'
import { routes } from '../routes.ts'
import { galleryCards } from '../ui/gallery-card.tsx'
import { icon } from '../ui/icons.tsx'
import { ogImage } from '../ui/og-image.ts'
import { picture } from '../ui/picture.tsx'
import { render } from '../ui/render.tsx'
export default {
async handler(context) {
const site = await loadSite(context)
const { config } = site.content
const featured = featuredGalleries(site.content)
const hero = featured[0] ? coverOf(featured[0]) : undefined
return render(
site,
{
canonical: canonicalUrl(site, routes.home.href()),
nav: 'home',
...ogImage(site, hero),
},
<>
{hero ? (
{picture(site, hero, {
sizes: '100vw',
priority: true,
class: 'hero-photo',
})}
) : null}
Featured work
{featured.length > 0 ? (
galleryCards(site, featured)
) : (
New work is on its way. Check back soon.
)}
>,
)
},
} satisfies Action