sanity
Version:
Sanity is a real-time content infrastructure with a scalable, hosted backend featuring a Graph Oriented Query Language (GROQ), asset pipelines and fast edge caches
24 lines (20 loc) • 755 B
text/typescript
import {RestoreIcon} from '@sanity/icons'
import {type DocumentInspector, useTranslation} from 'sanity'
import {useStructureTool} from '../../../../useStructureTool'
import {HISTORY_INSPECTOR_NAME} from '../../constants'
import {ChangesInspector} from './ChangesInspector'
export const changesInspector: DocumentInspector = {
name: HISTORY_INSPECTOR_NAME,
useMenuItem: () => {
const {features} = useStructureTool()
const {t} = useTranslation()
return {
hidden: !features.reviewChanges,
icon: RestoreIcon,
title: t('changes.title'),
}
},
component: ChangesInspector,
onClose: ({params}) => ({params: {...params, since: undefined}}),
onOpen: ({params}) => ({params: {...params, since: '@lastPublished'}}),
}