Refactor the custom helpers into their own files

This commit is contained in:
Oliver-Akins 2023-12-26 19:39:56 -07:00
parent af2df4f7c5
commit 0392d339db
7 changed files with 69 additions and 62 deletions

View file

@ -0,0 +1,11 @@
/**
* Checks if the specified collapseId is currently open, so that during re-renders
* it remains open or closed.
*
* @param {Set<string>} expanded A set indicating what collapseIds are expanded
* @param {string} collapseId The collapseId to check for
* @returns {"open"|null} The HTML insertion indicating the details is expanded
*/
export function detailsExpanded(expanded, collapseId) {
return expanded.has(collapseId) ? "open" : null;
};