joshborseth
joshborseth
Explore posts from servers
TTCTheo's Typesafe Cult
Created by joshborseth on 7/21/2024 in #questions
Shadcn and UploadThing component
"use client";
import { UploadButton } from "@/lib/uploadthing";
import { toast } from "sonner";

export const StatementUploadForm = () => {
return (
<UploadButton
endpoint="uploadStatement"
appearance={{
button:
"bg-primary focus-within:ring-primary ut-uploading:bg-primary ut-readying:bg-primary ut-ready:bg-primary after:bg-primary w-full",
container: "w-full",
}}
onClientUploadComplete={() => {
toast.success("File Uploaded");
}}
onUploadError={(error: Error) => {
toast.error("Error Uploading File", { description: error.message });
}}
/>
);
};
"use client";
import { UploadButton } from "@/lib/uploadthing";
import { toast } from "sonner";

export const StatementUploadForm = () => {
return (
<UploadButton
endpoint="uploadStatement"
appearance={{
button:
"bg-primary focus-within:ring-primary ut-uploading:bg-primary ut-readying:bg-primary ut-ready:bg-primary after:bg-primary w-full",
container: "w-full",
}}
onClientUploadComplete={() => {
toast.success("File Uploaded");
}}
onUploadError={(error: Error) => {
toast.error("Error Uploading File", { description: error.message });
}}
/>
);
};
idk if this would help anybody but heres a quick copy and paste of my upload button for use with shadcn. I found tracking down all of the classnames for the button to be cumbersome so I imagine this could help someone. Or maybe there is a better way and im just dumb lol
2 replies
DTDrizzle Team
Created by joshborseth on 9/14/2023 in #help
TypeError: Cannot read properties of undefined (reading 'compositePrimaryKeys')
I am attempting to run db push, but I am getting this error above^^ does anyone know what might be going on?
44 replies
TTCTheo's Typesafe Cult
Created by joshborseth on 1/17/2023 in #questions
Role based Authentication Question
I was looking to have an isAdmin middleware like option 2 here: https://trpc.io/docs/authorization However, my "role" field that isn't available in my context. How do I add it to my context? Sorry if thats a dumb q im new lol
10 replies
TTCTheo's Typesafe Cult
Created by joshborseth on 12/1/2022 in #questions
Tech Stack Question
Hey all, recently got the opportunity to rebuild a local businesses website. Im trying to decide what to use for it. I'm thinking WP cause it'll be easy? However, I hate WP so I'd rather not. There's lots of content so I think using a Headless CMS would be great. Are there any ones you guys recommend?
15 replies