Skip to content

A modern and easy to use dashboard. 80+ integrations. 20K+ icons built in. Authentication out of the box. No YAML, drag and drop configuration.

875 B
Raw Blame
import type { ClassValue } from "clsx";
import { clsx } from "clsx";
import { twMerge } from "tailwind-merge";

export function cn(...inputs: ClassValue[]) {
  return twMerge(clsx(inputs));
}

export function errorMessage(caught: unknown, fallback: string) {
  return caught instanceof Error ? caught.message : fallback;
}

export function oauthErrorMessage(caught: unknown) {
  const message = errorMessage(caught, "GitHub sign-in failed");
  if (/popup.*block|blocked.*popup/iu.test(message))
    return "GitHub sign-in popup was blocked. Allow popups for this site and try again.";
  if (/cancel|closed.*popup|popup.*closed/iu.test(message)) return "GitHub sign-in was cancelled before it completed.";
  if (/provider|oauth|redirect|callback|client.?id/iu.test(message))
    return "GitHub sign-in is not configured correctly on the Workshop server.";
  return message;
}