Skip to content

Instantly share code, notes, and snippets.

View tracepanic's full-sized avatar
:octocat:
Simply lovely

Trace Panic tracepanic

:octocat:
Simply lovely
View GitHub Profile
@tracepanic
tracepanic / client.ts
Last active May 8, 2025 18:17
How to use actionkit for server actions
import { BadRequestException, HttpException, handleAction } from "@repo/actionkit";
import { initializeLMS } from "@/lib/server";
import { ZodError } from "zod";
const { data, message, success, error } = await handleAction(initializeLMS,user,school);
// This is fully typesafe, handleAction can take minimum one argument for the server action
// Based on the number of arguements the server actions need you must pass typesafe number of arguements
// Data is undefined if the action is not returning anything or typesafe to the action response
// Message is always available same to success error, error can be undefined or of type ServerActionError
@tracepanic
tracepanic / globals.css
Created April 25, 2025 10:37
Button compatibility, tailwind v4 button uses default cursor
@layer base {
* {
@apply border-border outline-ring/50;
}
body {
@apply bg-background text-foreground;
}
button:not(:disabled),