import React from 'react'
import { Link, router, usePage } from '@inertiajs/react'
import SeoHead from '../../components/seo/SeoHead'
import NovaSelect from '../../components/ui/NovaSelect'
function academyHref(section, slug) {
return `/academy/${section}/${encodeURIComponent(slug)}`
}
function QueryFilters({ pageType, filters, categories }) {
if (pageType !== 'lessons' && pageType !== 'prompts') {
return null
}
const categoryOptions = [{ value: '', label: 'All categories' }, ...(categories || []).map((category) => ({ value: category.slug, label: category.name }))]
const difficultyOptions = [
{ value: '', label: 'All levels' },
{ value: 'beginner', label: 'Beginner' },
{ value: 'intermediate', label: 'Intermediate' },
{ value: 'advanced', label: 'Advanced' },
{ value: 'pro', label: 'Pro' },
]
return (
{
if (event.key !== 'Enter') return
router.get(window.location.pathname, { ...filters, q: event.currentTarget.value }, { preserveState: true, preserveScroll: true })
}}
/>
router.get(window.location.pathname, { ...filters, category: nextValue || undefined }, { preserveState: true, preserveScroll: true })}
options={categoryOptions}
searchable={false}
className="rounded-2xl bg-white/[0.04]"
placeholder="All categories"
/>
router.get(window.location.pathname, { ...filters, difficulty: nextValue || undefined }, { preserveState: true, preserveScroll: true })}
options={difficultyOptions}
searchable={false}
className="rounded-2xl bg-white/[0.04]"
placeholder="All levels"
/>
)
}
function LockBadge({ item }) {
if (!item?.locked) return {item.access_level}
return Locked · {item.access_level}
}
function itemHref(pageType, item) {
if (pageType === 'lessons') return academyHref('lessons', item.slug)
if (pageType === 'prompts') return academyHref('prompts', item.slug)
if (pageType === 'packs') return academyHref('packs', item.slug)
return academyHref('challenges', item.slug)
}
function PromptLibraryHero({ title, description, items, pricingUrl }) {
const featuredImages = (items || [])
.map((item) => item?.preview_image)
.filter(Boolean)
.slice(0, 3)
const primaryImage = featuredImages[0] || ''
const supportingImages = featuredImages.slice(1, 3)
return (
Skinbase AI Academy
Prompt Library
{title}
{description}
Visual-first
Preview prompt results before opening the detail page.
Reusable
Templates for wallpapers, covers, worlds, portraits, and more.
Comparison-ready
See which prompts include provider-specific notes and outputs.
Upgrade preview
{items?.length || 0} prompts in view
{primaryImage ? (
<>
{supportingImages.length ? (
{supportingImages.map((image, index) => (
))}
) : null}
>
) : (
Prompt preview images will appear here
)}
)
}
function AcademyCard({ pageType, item }) {
const lessonSeries = String(item?.series_name || '').trim()
const promptPreviewImage = item?.preview_image || ''
if (pageType === 'prompts') {
return (
{promptPreviewImage ?

: null}
Prompt template
{item?.difficulty ? {item.difficulty} : null}
{item?.aspect_ratio ? {item.aspect_ratio} : null}
{item?.category?.name || 'Academy'}
{Array.isArray(item?.tool_notes) && item.tool_notes.length ?
{item.tool_notes.length} comparisons : null}
{item.title}
{item.excerpt || item.description || item.prompt_preview || 'No description yet.'}
{item.tags?.length ?
{item.tags.slice(0, 4).join(' · ')}
: null}
)
}
return (
{pageType === 'lessons' && item?.formatted_lesson_number ? (
{item.formatted_lesson_number}
{lessonSeries ? {lessonSeries} : null}
) : null}
{item.title}
{item.excerpt || item.description || item.prompt_preview || item.content_preview || 'No description yet.'}
{pageType === 'lessons' && item.tags?.length ? {item.tags.slice(0, 4).join(' · ')}
: null}
{pageType === 'prompts' && item.tags?.length ? {item.tags.slice(0, 4).join(' · ')}
: null}
{pageType === 'challenges' ? {item.status} · {item.submission_count ?? 0} submissions
: null}
)
}
export default function AcademyList({ pageType, title, description, seo, items, filters, categories, pricingUrl }) {
const flash = usePage().props.flash || {}
const visibleItems = Array.isArray(items?.data) ? items.data : []
return (
{pageType === 'prompts' ?
: (
Skinbase AI Academy
{title}
{description}
Upgrade preview
)}
{flash.success ?
{flash.success}
: null}
{flash.error ?
{flash.error}
: null}
{visibleItems.length === 0 ? (
Nothing matched this Academy view yet.
) : (
{visibleItems.map((item) => )}
)}
)
}