const base = () => '/library';

const article = (rootId: number, childId?: number) =>
  childId && childId !== rootId
    ? `${base()}/${rootId}/child/${childId}`
    : `${base()}/${rootId}`;

export const huLibrariesRoutes = {
  base,
  article,
  edit: (rootId: number, childId?: number) =>
    `${article(rootId, childId)}/edit`,
};
