import { Plus } from 'lucide-react'
import type { ReactNode } from 'react'
import { EXPLORER_SECTIONS, type ExplorerResourceType } from './ExplorerLayout.constants'
import { useCreateChat, useCreateNotebook } from '@/components/interfaces/Explorer/hooks'
import { SidebarBreadcrumb } from '@/components/layouts/Navigation/SidebarBreadcrumb'
import { ButtonTooltip } from '@/components/ui/ButtonTooltip'
export const ExplorerNavHeader = ({
section,
onBack,
rootAction,
}: {
section: ExplorerResourceType | undefined
onBack: () => void
rootAction?: ReactNode
}) => {
const label = EXPLORER_SECTIONS.find((entry) => entry.type === section)?.label ?? 'Explorer'
return (
: rootAction}
/>
)
}
const ExplorerResourceAction = ({ type }: { type: ExplorerResourceType }) => {
const { createNotebook } = useCreateNotebook()
const { createChat } = useCreateChat()
return (
}
tooltip={{ content: { side: 'bottom', text: `New ${type}` } }}
onClick={() => {
if (type === 'notebook') createNotebook()
if (type === 'chat') createChat()
}}
/>
)
}