Files
mintel.me/apps/web/src/payload/collections/Media.ts
Marc Mintel 11f735bbdf
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 16s
Build & Deploy / 🏗️ Build (push) Failing after 6m58s
Build & Deploy / 🚀 Deploy (push) Has been skipped
Build & Deploy / 🧪 QA (push) Has been skipped
Build & Deploy / 🧪 Post-Deploy Verification (push) Has been skipped
Build & Deploy / 🔔 Notify (push) Successful in 1s
fix: resolve admin white screen via static ChatWindowProvider import
- Statically declare ChatWindowProvider in payload.config.ts admin.components.providers
- Regenerate importMap.js with correct component mappings
- Update Dockerfile to support _at-mintel monorepo sync for local builds
- Add .gitignore entries for manual build artifacts
- Update blocks and collections (payload-ai integration updates)
- Sync pnpm-lock.yaml
2026-03-07 11:47:52 +01:00

66 lines
1.4 KiB
TypeScript

import type { CollectionConfig } from "payload";
import path from "path";
import { fileURLToPath } from "url";
import { replicateMediaHandler } from "@mintel/payload-ai/endpoints/replicateMediaEndpoint";
const filename = fileURLToPath(import.meta.url);
const dirname = path.dirname(filename);
export const Media: CollectionConfig = {
slug: "media",
admin: {
useAsTitle: "alt",
defaultColumns: ["filename", "alt", "updatedAt"],
},
access: {
read: () => true, // Publicly readable
},
endpoints: [
{
path: "/:id/ai-process",
method: "post",
handler: replicateMediaHandler as any,
},
],
upload: {
staticDir: path.resolve(dirname, "../../../../public/media"),
adminThumbnail: "thumbnail",
imageSizes: [
{
name: "thumbnail",
width: 400,
height: 300,
position: "centre",
},
{
name: "card",
width: 768,
height: 1024,
position: "centre",
},
{
name: "tablet",
width: 1024,
height: undefined,
position: "centre",
},
],
},
fields: [
{
name: "aiProcessButtons",
type: "ui",
admin: {
components: {
Field: "@mintel/payload-ai/components/AiMediaButtons#AiMediaButtons",
},
},
},
{
name: "alt",
type: "text",
required: true,
},
],
};