/**
 * Canonical admin routes for opening / creating documents.
 *
 * Post-type and Pages collections have dedicated section-based editors that the
 * generic `/:collection/:id` route does NOT reach — routing a post through the
 * generic editor silently strips its `sections` data, and a post collection
 * whose slug is `posts` 404s under `/:collection/:id` entirely. Centralizing the
 * mapping here keeps `Dashboard`, `CollectionList`, and any future caller in
 * agreement instead of each re-deriving (and getting it wrong).
 */
/** The route that opens an existing document in its correct editor. */
export function editPathForDoc(col, collection, id) {
    if (col?.type === 'post')
        return `/posts/${collection}/${id}/edit`;
    if (collection === 'pages')
        return `/pages/${id}/edit`;
    return `/${collection}/${id}`;
}
/** The route that starts a new document in the correct editor. */
export function newPathForCollection(col, collection) {
    if (col?.type === 'post')
        return `/posts/${collection}/new`;
    if (collection === 'pages')
        return `/pages/new`;
    return `/${collection}/new`;
}
//# sourceMappingURL=collection-routes.js.map