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
/** | |
* Type-safe wrapper around Prismic's `isFilled.contentRelationship` function to make link fields more type-safe. | |
* You'll want to make sure that your Prismic client is set up to handle typed content. | |
* | |
* If using Next.js and Slice Machine, you can use the `@prismicio/client` package to set up typed content. | |
* @see {@link https://prismic.io/docs/typescript-nextjs} for more information. | |
* | |
* Prismic also offers support via the `prismic-ts-codegen` package. | |
* @see {@link https://prismic.io/docs/technical-reference/prismic-ts-codegen} for more information. | |
*/ |
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 an array. | |
* | |
* @template T - The type of the array elements. | |
* @param {Array<T | null | undefined>} arr - The array to be filtered. | |
* @returns {Array<T>} - A new array with null and undefined values removed. | |
* | |
* @example | |
* const fruits = ['apple', null, 'banana', undefined, 'cherry']; | |
* const validFruits = filterEmpty(fruits); |
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: [ |