41 lines
1009 B
TypeScript
41 lines
1009 B
TypeScript
import type { ServerSideEditViewProps } from 'payload'
|
|
|
|
import { SetStepNav } from '@payloadcms/ui'
|
|
import { notFound } from 'next/navigation.js'
|
|
import React, { Fragment } from 'react'
|
|
|
|
import { customTabViewComponentTitle } from '../../../shared.js'
|
|
|
|
export const CustomTabComponentView: React.FC<ServerSideEditViewProps> = ({ initPageResult }) => {
|
|
if (!initPageResult) {
|
|
notFound()
|
|
}
|
|
|
|
return (
|
|
<Fragment>
|
|
<SetStepNav
|
|
nav={[
|
|
{
|
|
label: 'Custom Tab View 2',
|
|
},
|
|
]}
|
|
/>
|
|
<div
|
|
style={{
|
|
marginTop: 'calc(var(--base) * 2)',
|
|
paddingLeft: 'var(--gutter-h)',
|
|
paddingRight: 'var(--gutter-h)',
|
|
}}
|
|
>
|
|
<h1 id="custom-view-title">{customTabViewComponentTitle}</h1>
|
|
<p>This custom view was added through the Payload config:</p>
|
|
<ul>
|
|
<li>
|
|
<code>components.views[key].Component</code>
|
|
</li>
|
|
</ul>
|
|
</div>
|
|
</Fragment>
|
|
)
|
|
}
|