Files
payloadcms/test/admin/components/CustomTabComponent/index.tsx
2024-03-08 12:33:44 -05:00

20 lines
469 B
TypeScript

'use client'
import React from 'react'
import { Link, useRouteMatch } from 'react-router-dom'
import type { DocumentTabComponent } from '../../../../packages/payload/src/admin/types.js'
import './index.scss'
export const CustomTabComponent: DocumentTabComponent = (props) => {
const { path } = props
const match = useRouteMatch()
return (
<li className="custom-doc-tab">
<Link to={`${match.url}${path}`}>Custom Tab Component</Link>
</li>
)
}