import { useParams, useNavigate, useLocation } from 'react-router-dom' import { useAppPath } from '@core/hooks/useAppPath' import { KBArticleEditor } from '@core/components/kb/KBArticleEditor' const DEFAULT_NEW_TYPE_SLUG = 'kb-spine-internal' export default function KBArticleEditorPage() { const { id } = useParams<{ id: string }>() const navigate = useNavigate() const appPath = useAppPath() const location = useLocation() const path = location.pathname const isNew = !id || id === 'new' || path.endsWith('/new') const isEdit = !isNew && path.endsWith('/edit') const mode = isNew ? 'new' : isEdit ? 'edit' : 'view' return (