Files
payloadcms/test/admin/components/views/CustomTabComponent/index.tsx

41 lines
1.0 KiB
TypeScript

import { SetStepNav } from '@payloadcms/ui/elements/StepNav'
import { notFound } from 'next/navigation.js'
import React, { Fragment } from 'react'
import type { ServerSideEditViewProps } from '../../../../../packages/payload/types.js'
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>
)
}