damus.io

damus.io website
git clone git://jb55.com/damus.io
Log | Files | Refs | README | LICENSE

ErrorDialog.tsx (1189B)


      1 import { ErrorDialog } from "@/components/ErrorDialog";
      2 import { LNCheckout } from "./Types";
      3 import { Copy } from "lucide-react";
      4 
      5 export interface PurpleCheckoutErrorDialogProps {
      6   lnCheckout: LNCheckout | null;
      7   error: string | null;
      8   setError: (error: string | null) => void;
      9 }
     10 
     11 export function PurpleCheckoutErrorDialog(props: PurpleCheckoutErrorDialogProps) {
     12   const { lnCheckout, error, setError } = props;
     13   
     14   return (
     15     <ErrorDialog error={error} setError={setError}>
     16       {lnCheckout && lnCheckout.id && (
     17         <div className="flex items-center justify-between rounded-md bg-gray-200">
     18           <div className="text-xs text-gray-400 font-normal px-4 py-2">
     19             Reference:
     20           </div>
     21           <div className="w-full text-xs text-gray-500 font-normal px-4 py-2 overflow-x-scroll">
     22             {lnCheckout?.id}
     23           </div>
     24           <button
     25             className="text-sm text-gray-500 font-normal px-4 py-2 active:text-gray-500/30 hover:text-gray-500/80 transition"
     26             onClick={() => navigator.clipboard.writeText(lnCheckout?.id || "")}
     27           >
     28             <Copy />
     29           </button>
     30         </div>
     31       )}
     32     </ErrorDialog>
     33   );
     34 }