Skip to content

DropdownItem as button #1510

Answered by idc77
idc77 asked this question in Q&A
Discussion options

You must be logged in to vote
import {DropdownItem} from 'flowbite-react';
import {useTranslations} from 'next-intl';
import React from 'react';
import {signOut} from '@/auth';

export default function SignOut() {
    const t = useTranslations()
    async function signOutAction() {
        "use server"
        await signOut({redirectTo: "/"})
    }
    return (
        <>
            <DropdownItem onClick={signOutAction}>
                {t('auth.sign_out')}
            </DropdownItem>
        </>
    )
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by idc77
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant