"use client" import { useCallback, useEffect, useState } from "react" import { Loader2 } from "lucide-react" import { Button } from "@/components/ui/button" import { Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogTitle, } from "@/components/ui/dialog" export type AuthentikEmbedDialogProps = { url: string title: string open: boolean onOpenChange: (open: boolean) => void description?: string } export function AuthentikEmbedDialog({ url, title, open, onOpenChange, description, }: AuthentikEmbedDialogProps) { const [isLoading, setIsLoading] = useState(true) useEffect(() => { if (open) { setIsLoading(true) } }, [open, url]) const handleIframeLoad = useCallback(() => { setIsLoading(false) }, []) return ( {title} {description ? ( {description} ) : null}
{isLoading ? (
Chargement du portail d'identité…
) : null}