export function sortSessions(sessions) {
  return [...sessions].sort((left, right) => right.updatedAt.localeCompare(left.updatedAt));
}

export function sessionContext(session, accounts, workspaces) {
  return {
    accountLabel: accounts.find((item) => item.id === session.accountId)?.label ?? session.accountId,
    workspaceLabel: workspaces.find((item) => item.id === session.workspaceId)?.label ?? session.workspaceId
  };
}
