Skip to content

Instantly share code, notes, and snippets.

@tsemachh
tsemachh / CustomDefaultEditView.tsx
Created September 1, 2024 08:41
Compound Relation View in Edit View Component
import type { EditViewComponent, PayloadServerReactComponent } from 'payload'
import { EditView } from '@payloadcms/next/views'
import React from 'react'
import { DocumentDrawerContent } from './DocumentView'
const CustomDefaultEditView: PayloadServerReactComponent<EditViewComponent> = () => {
return (
<div style={{ display: 'flex' }}>
<div style={{ width: '50%' }}>
<EditView />
@tsemachh
tsemachh / Media.ts
Last active August 20, 2024 05:24
PayloadCms 3.00 Thumbnail for video asset
import path from 'path'
import { fileURLToPath } from 'url'
import { type CollectionConfig } from 'payload'
import { videoCoverImage } from './hooks/videoCoverImage'
/* eslint-enable */
const __filename = fileURLToPath(import.meta.url)
const __dirname = path.dirname(__filename)
// eslint-disable-next-line @typescript-eslint/ban-ts-comment