import { useParams } from 'common' import dayjs from 'dayjs' import { AnimatePresence, motion } from 'framer-motion' import Link from 'next/link' import { useEditorType } from '../editors/EditorsLayout.hooks' import { buildTableEditorUrl } from '@/components/grid/BrivenGrid.utils' import { EntityTypeIcon } from '@/components/ui/EntityTypeIcon' import { ENTITY_TYPE } from '@/data/entity-types/entity-type-constants' import { editorEntityTypes, useTabsStateSnapshot } from '@/state/tabs' export function RecentItems() { const { ref } = useParams() const tabs = useTabsStateSnapshot() const editor = useEditorType() if (!tabs?.recentItems || !ref) return null // Filter items based on editor type const filteredItems = !editor ? [...tabs.recentItems] : tabs.recentItems.filter((item) => editorEntityTypes[editor].includes(item.type)) const sortedItems = filteredItems.sort((a, b) => b.timestamp - a.timestamp) return (
No recent items yet
Items will appear here as you browse through your project