Add a select all button

This commit is contained in:
2024-07-20 10:39:35 -05:00
parent 2bb53cb731
commit 1b6d447c36
6 changed files with 62 additions and 23 deletions

View File

@ -1,13 +1,25 @@
import Image from "next/image";
import { auth } from "~/auth"
import { signOut } from "~/auth"
export default function Sign_Out() {
return (
<form className="w-full"
action={async () => {
"use server"
await signOut()
}}>
<button type="submit" className="w-full">Sign Out</button>
</form>
)
}
export default async function Sign_Out() {
const session = await auth();
if (!session) {
return (<div/>);
} else {
// Add User profile picture next to Sign Out button
const pfp = session?.user?.image ? session.user.image : "/images/default_user_pfp.png";
return (
<form className="w-full flex flex-row"
action={async () => {
"use server"
await signOut()
}}>
<Image src={pfp} alt="" width={35} height={35}
className="rounded-full border-2 border-white m-auto mr-4"
/>
<button type="submit" className="w-full">Sign Out</button>
</form>
);
}
};