Skip to content

Instantly share code, notes, and snippets.

"use client";
import { useRouter } from "next/navigation";
import { Loader2 } from "lucide-react";
import { api } from "../../../providers/trpc-provider";
import PaymentButton from "../../_components/payment-button";
export default function PayrollProcessPage() {
const authToken = api.upwork.currentSessionToken.useQuery();
const router = useRouter();
@anis-dr
anis-dr / helpers.ts
Last active October 7, 2024 06:09
Zustand middleware to sync state with electron main proces
import { UseBoundStore } from 'zustand/esm';
import { StoreApi } from 'zustand';
import type { ElectronSyncOptions } from './middleware';
export function getSerializableState(excludes: string[], state: unknown) {
return JSON.parse(
JSON.stringify(state, (key, value) => {
if (typeof value === 'function' || excludes.includes(key)) {
return undefined;
}