This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* This is an Immediately Invoked Function Expression (IIFE). | |
* It's a good way to isolate variables declarations. | |
* The JavaScript parser runs this function as soon as it encounters it in the script. | |
*/ | |
(function () { | |
/** | |
* Type definition for a callback function. | |
* The function can accept any number of arguments of any type. | |
*/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"use client"; | |
import markerSDK, { | |
type MarkerProjectWidgetParams, | |
type MarkerSdk, | |
} from "@marker.io/browser"; | |
import { useEffect, useMemo, useState } from "react"; | |
// Import environment variables. | |
const MARKERIO_PROJECT_ID: string | undefined = process.env.MARKERIO_PROJECT_ID // <- CHANGE THIS IN YOUR CODE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Filters out null and undefined values from the given object or array, including nested objects and arrays. | |
* @param {T} inputObj - The input object or array to filter. | |
* @returns {Required<{ [K in keyof T]: NonNullable<T[K]> }>} - A new object or array with the same structure as the input, but with all null and undefined values removed. | |
* @template T - The type of the input object or array, extending Record<string, any> or any[]. | |
*/ | |
export function filterNullAndUndefined<T extends Record<string, any> | any[]>( | |
inputObj: T, | |
): Required<{ [K in keyof T]: NonNullable<T[K]> }> { | |
if (typeof inputObj !== "object" || inputObj === null) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { rgba } from "polished"; | |
export default { | |
label: [ | |
rgba(0, 0, 0, 1), | |
rgba(60, 60, 67, 0.6), | |
rgba(60, 60, 67, 0.3), | |
rgba(60, 60, 67, 0.18), | |
], | |
fill: [ |