mirror of
https://github.com/Sea-Haven-Industries/open-swe.git
synced 2026-10-03 05:43:27 +00:00
* Apply patch x10 * fix build * unifying GH org installations [org select, repo select, /github] * github multi installation management * clean git diff * CR: remove HTTP constraint from GH install cookie, rm api endpoint, update hooks * CR: use octokit types for GH install * CR: GH loading component, fix org selector icons * minor github loading fix * rm un-needed gh install api route * CR: InstallationCookieOptions --------- Co-authored-by: open-swe-dev[bot] <open-swe-dev@users.noreply.github.com> Co-authored-by: starmorph <dylan@starmorph.com> Co-authored-by: Dylan Boudro <121908331+starmorph@users.noreply.github.com>
22 lines
579 B
TypeScript
22 lines
579 B
TypeScript
import { type ClassValue, clsx } from "clsx";
|
|
import { twMerge } from "tailwind-merge";
|
|
|
|
export function cn(...inputs: ClassValue[]) {
|
|
return twMerge(clsx(inputs));
|
|
}
|
|
|
|
/**
|
|
* Utility function to get a cookie value by name from the client-side
|
|
*/
|
|
export function getCookie(name: string): string | null {
|
|
if (typeof document === "undefined") {
|
|
return null; // Return null during SSR
|
|
}
|
|
|
|
const value = `; ${document.cookie}`;
|
|
const parts = value.split(`; ${name}=`);
|
|
if (parts.length === 2) {
|
|
return parts.pop()?.split(";").shift() || null;
|
|
}
|
|
return null;
|
|
}
|