diff --git a/src/app/page.tsx b/src/app/page.tsx index 826881dbd..7ffd34bf4 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -85,7 +85,7 @@ const HomePage = async () => { -
+
homepage photography image tiles { - +

diff --git a/src/utils/enum.ts b/src/utils/enum.ts index 395a6ad88..27e77f018 100644 --- a/src/utils/enum.ts +++ b/src/utils/enum.ts @@ -1,14 +1,29 @@ +/** + * Converts an enum value to its corresponding string key. + * + * @param {E} enumValue - the enum value to convert + * @param {Record} enumType - the enum type to search for the value in + * @return {string | undefined} the string key corresponding to the enum value, or undefined if not found + */ export function enumToString( enumValue: E, enumType: Record, ): string | undefined { const keys = Object.keys(enumType); + console.log(`keys: ${keys}`); const key = keys.find( (k) => enumType[k as keyof typeof enumType] === enumValue, ); return key; } +/** + * Finds the key in the enumType and returns the corresponding value. + * + * @param {unknown} key - The key to search for in the enumType. + * @param {Record} enumType - The enumType to search within. + * @return {E | undefined} The corresponding value of the key if found, otherwise undefined. + */ export function stringToEnum( key: unknown, enumType: Record,