import { classNames } from "@documenso/lib"; import { Button, IconButton } from "@documenso/ui"; import { Dialog, Transition } from "@headlessui/react"; import { BuildingOfficeIcon, CreditCardIcon, LanguageIcon, PencilIcon, UserIcon, UsersIcon, XMarkIcon, } from "@heroicons/react/24/outline"; import React from "react"; import { Fragment, useState } from "react"; const tabs = [ { name: "Type", href: "#", icon: LanguageIcon, current: true }, { name: "Draw", href: "#", icon: PencilIcon, current: false }, ]; export default function SignatureDialog(props: any) { const [currentTab, setCurrentTab] = useState(tabs[0]); const [typedName, setTypedName] = useState(""); return ( <>
{isCurrentTab("Type") ? (
{ setTypedName(e.target.value); }} className="mt-3 p-1 text-center block border-b w-full border-gray-300 focus:border-neon focus:ring-neon text-2xl" placeholder="Kindly type your name" />
) : ( "" )} {isCurrentTab("Draw") ? (
) : ( "" )}
); function isCurrentTab(tabName: string): boolean { return currentTab.name === tabName; } function setCurrent(t: any) { tabs.forEach((tab) => { tab.current = tab.name === t.name; }); setCurrentTab(t); } }