jai #21
|
|
@ -398,7 +398,7 @@ const ProcessStepOne = () => {
|
||||||
className='flex items-center gap-3'>
|
className='flex items-center gap-3'>
|
||||||
|
|
||||||
{transactionTemplateToggle === TRANSACTION_TEMPLATE_TOGGLE.TEMPLATES && <button
|
{transactionTemplateToggle === TRANSACTION_TEMPLATE_TOGGLE.TEMPLATES && <button
|
||||||
onClick={() => handleNextClick(false, true)}
|
onClick={() => handleNextClick(true)}
|
||||||
className="text-sm px-4 py-2 rounded bg-[var(--primary)] text-white shadow hover:bg-[var(--primaryLight2)] transition cursor-pointer"
|
className="text-sm px-4 py-2 rounded bg-[var(--primary)] text-white shadow hover:bg-[var(--primaryLight2)] transition cursor-pointer"
|
||||||
>
|
>
|
||||||
Save & Close
|
Save & Close
|
||||||
|
|
|
||||||
|
|
@ -47,8 +47,8 @@ interface Signature {
|
||||||
}
|
}
|
||||||
|
|
||||||
interface AddSignatureModalProps {
|
interface AddSignatureModalProps {
|
||||||
// setShowAddSignature?: (value: boolean) => void;
|
setOpenSign?: (value: boolean) => void;
|
||||||
// getAllSignatures: () => Promise<void>;
|
getAllSignatures: () => Promise<void>;
|
||||||
// editingSignature?: Signature | null;
|
// editingSignature?: Signature | null;
|
||||||
|
|
||||||
recipientId?: string;
|
recipientId?: string;
|
||||||
|
|
@ -88,7 +88,7 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
|
||||||
}) => {
|
}) => {
|
||||||
|
|
||||||
console.log("savedModal", recipient)
|
console.log("savedModal", recipient)
|
||||||
const [activeTab, setActiveTab] = useState<'TYPED' | 'DRAW' | 'UPLOAD' | 'SAVED'>('TYPED');
|
const [activeTab, setActiveTab] = useState<'SELECT' | 'DRAW' | 'UPLOAD' | 'SAVED'>('SELECT');
|
||||||
const [fullName, setFullName] = useState('');
|
const [fullName, setFullName] = useState('');
|
||||||
const [initials, setInitials] = useState('');
|
const [initials, setInitials] = useState('');
|
||||||
const [isSubmitting, setIsSubmitting] = useState<boolean>(false);
|
const [isSubmitting, setIsSubmitting] = useState<boolean>(false);
|
||||||
|
|
@ -133,13 +133,15 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
|
||||||
// Store the preview URL
|
// Store the preview URL
|
||||||
const [preview1, setPreview1] = useState<string | null>(null);
|
const [preview1, setPreview1] = useState<string | null>(null);
|
||||||
const [preview2, setPreview2] = useState<string | null>(null);
|
const [preview2, setPreview2] = useState<string | null>(null);
|
||||||
|
const [checked, setChecked] = useState(false);
|
||||||
|
const toggleCheckbox = () => setChecked(!checked);
|
||||||
|
|
||||||
const [preSaveSignatures, setPreSaveSignatures] = useState([])
|
const [preSaveSignatures, setPreSaveSignatures] = useState([])
|
||||||
|
|
||||||
|
|
||||||
// Navigation items
|
// Navigation items
|
||||||
const navigationItems = [
|
const navigationItems = [
|
||||||
{ id: 'TYPED', label: 'TYPED', icon: <GrCheckboxSelected className="w-4 h-4" /> },
|
{ id: 'SELECT', label: 'SELECT', icon: <GrCheckboxSelected className="w-4 h-4" /> },
|
||||||
{ id: 'DRAW', label: 'DRAW', icon: <AiOutlineEdit className="w-5 h-5" /> },
|
{ id: 'DRAW', label: 'DRAW', icon: <AiOutlineEdit className="w-5 h-5" /> },
|
||||||
{ id: 'UPLOAD', label: 'UPLOAD', icon: <AiOutlineUpload className="w-5 h-5" /> },
|
{ id: 'UPLOAD', label: 'UPLOAD', icon: <AiOutlineUpload className="w-5 h-5" /> },
|
||||||
{ id: 'SAVED', label: 'SAVED', icon: <CiSaveDown1 className="w-5 h-5" /> },
|
{ id: 'SAVED', label: 'SAVED', icon: <CiSaveDown1 className="w-5 h-5" /> },
|
||||||
|
|
@ -321,32 +323,283 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// const renderContent = () => {
|
||||||
|
// switch (activeTab) {
|
||||||
|
// case 'SELECT':
|
||||||
|
// return (
|
||||||
|
// <div className="h-full flex flex-col ">
|
||||||
|
// <div className="mb-6">
|
||||||
|
// <h2 className="text-xl font-semibold text-gray-900 mb-2">Choose Signature Style</h2>
|
||||||
|
// <p className="text-sm text-gray-600">Select from pre-designed signature styles</p>
|
||||||
|
// </div>
|
||||||
|
|
||||||
|
// <div className="flex-1 overflow-y-auto">
|
||||||
|
// <div className="space-y-4">
|
||||||
|
// {signatureOptions.map((option) => (
|
||||||
|
// <div key={option.id} className="flex items-center space-x-4 px-2 py-1 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors">
|
||||||
|
// <input
|
||||||
|
// type="radio"
|
||||||
|
// id={`signature-${option.id}`}
|
||||||
|
// name="signature"
|
||||||
|
// checked={selectedSignature.id === option.id}
|
||||||
|
// onChange={() => setSelectedSignature({ id: option.id, style: option.style })}
|
||||||
|
// className="w-4 h-4 text-blue-600 focus:ring-blue-500"
|
||||||
|
// />
|
||||||
|
// <div className="flex-1 grid grid-cols-2 gap-2">
|
||||||
|
// <div className=" border-gray-300 rounded-lg px-2 py-1 bg-white ">
|
||||||
|
// <div className="text-xs text-gray-500 mb-2">Signed by:</div>
|
||||||
|
// <div className={`text-lg ${option.style === 'cursive' ? 'font-serif italic' :
|
||||||
|
// option.style === 'script' ? 'font-mono' :
|
||||||
|
// option.style === 'elegant' ? 'font-serif' :
|
||||||
|
// option.style === 'modern' ? 'font-sans tracking-wide' :
|
||||||
|
// 'font-sans'
|
||||||
|
// }`}>
|
||||||
|
// {fullName || option.name}
|
||||||
|
// </div>
|
||||||
|
// <div className="text-xs text-gray-400 mt-2">
|
||||||
|
// dca3e646-62cd-4cc...
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// <div className=" rounded-lg px-2 py-2 bg-white ">
|
||||||
|
// <div className="text-xs text-gray-500 mb-2">DS</div>
|
||||||
|
// <div className={`text-2xl ${option.style === 'cursive' ? 'font-serif italic' :
|
||||||
|
// option.style === 'script' ? 'font-mono' :
|
||||||
|
// option.style === 'elegant' ? 'font-serif' :
|
||||||
|
// option.style === 'modern' ? 'font-sans tracking-wide' :
|
||||||
|
// 'font-sans'
|
||||||
|
// }`}>
|
||||||
|
// {initials || option.initials}
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// ))}
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// );
|
||||||
|
|
||||||
|
// case 'DRAW':
|
||||||
|
// return (
|
||||||
|
// <DrawSignatureCanvas
|
||||||
|
// onSignatureChange={handleSignatureChange}
|
||||||
|
// // initialSignatures={isEditMode ? signatures : undefined}
|
||||||
|
// />
|
||||||
|
// );
|
||||||
|
|
||||||
|
// case 'UPLOAD':
|
||||||
|
// return (
|
||||||
|
// <div className="h-full flex flex-col">
|
||||||
|
// <div className="mb-6">
|
||||||
|
// <h2 className="text-xl font-semibold text-gray-900 mb-2">Upload Signature</h2>
|
||||||
|
// </div>
|
||||||
|
// <div className="flex-1 overflow-y-auto">
|
||||||
|
// <div>
|
||||||
|
// <div className="grid grid-cols-12 gap-6">
|
||||||
|
// {/* Upload 1 */}
|
||||||
|
// <div className="col-span-8">
|
||||||
|
// <label className="block text-sm font-medium text-gray-700 mb-2">Full Signature</label>
|
||||||
|
// <label htmlFor="upload1" className=" border-2 border-dashed border-gray-300 rounded-lg h-62 flex items-center justify-center bg-gray-50 hover:bg-gray-100 cursor-pointer transition-colors">
|
||||||
|
// {preview1 ? (
|
||||||
|
// <img src={preview1} alt="Signature Preview" className="max-h-44 object-contain" />
|
||||||
|
// ) : (
|
||||||
|
// <div className="text-center">
|
||||||
|
// <MdCloudUpload className="mx-auto h-12 w-12 text-gray-400 mb-3" />
|
||||||
|
// <p className="text-sm text-gray-500 mb-1">Click to upload or drag and drop</p>
|
||||||
|
// <p className="text-xs text-gray-400">PNG, JPG, GIF up to 10MB</p>
|
||||||
|
// </div>
|
||||||
|
// )}
|
||||||
|
// </label>
|
||||||
|
// <input
|
||||||
|
// id="upload1"
|
||||||
|
// type="file"
|
||||||
|
// accept="image/*"
|
||||||
|
// className="hidden"
|
||||||
|
// onChange={(e) => handleImageChange(e, setFile1, setPreview1, "fullSignature")}
|
||||||
|
// />
|
||||||
|
// </div>
|
||||||
|
|
||||||
|
// {/* Upload 2 */}
|
||||||
|
// <div className="col-span-4">
|
||||||
|
// <label className="block text-sm font-medium text-gray-700 mb-2">Initials</label>
|
||||||
|
// <label htmlFor="upload2" className=" border-2 border-dashed border-gray-300 rounded-lg h-62 flex items-center justify-center bg-gray-50 hover:bg-gray-100 cursor-pointer transition-colors">
|
||||||
|
// {preview2 ? (
|
||||||
|
// <img src={preview2} alt="Initials Preview" className="max-h-44 object-contain" />
|
||||||
|
// ) : (
|
||||||
|
// <div className="text-center">
|
||||||
|
// <MdCloudUpload className="mx-auto h-8 w-8 text-gray-400 mb-2" />
|
||||||
|
// <p className="text-xs text-gray-500">Upload initials</p>
|
||||||
|
// </div>
|
||||||
|
// )}
|
||||||
|
// </label>
|
||||||
|
// <input
|
||||||
|
// id="upload2"
|
||||||
|
// type="file"
|
||||||
|
// accept="image/*"
|
||||||
|
// className="hidden"
|
||||||
|
// onChange={(e) => handleImageChange(e, setFile2, setPreview2, "initials")}
|
||||||
|
// />
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// );
|
||||||
|
// case 'SAVED':
|
||||||
|
// return (
|
||||||
|
// <div className="h-full flex flex-col ">
|
||||||
|
// <div className="mb-6">
|
||||||
|
// <h2 className="text-xl font-semibold text-gray-900 mb-2">Saved Signature's</h2>
|
||||||
|
// {/* <p className="text-sm text-gray-600">Select from pre-designed signature styles</p> */}
|
||||||
|
// </div>
|
||||||
|
|
||||||
|
// <div className="flex-1 overflow-y-auto">
|
||||||
|
// <div className="space-y-4">
|
||||||
|
// {preSaveSignatures.map((signature) => (
|
||||||
|
// <div key={signature?.id} className="grid grid-cols-12 gap-4 px-6 py-9 hover:bg-gray-50 transition-colors duration-150">
|
||||||
|
// {/* Signature Column */}
|
||||||
|
// <div className="col-span-5">
|
||||||
|
// <div className="flex flex-col space-y-2 relative ps-6 border-l-3 border-blue-600 rounded-bl-2xl rounded-tl-2xl">
|
||||||
|
// <div className="text-sm text-gray-600 font-medium mb-1">
|
||||||
|
// Signed by:
|
||||||
|
// </div>
|
||||||
|
|
||||||
|
// {/* Signature Image or Fallback Text */}
|
||||||
|
// <div className="bg-white rounded-lg p-1 flex items-center justify-center">
|
||||||
|
// {signature?.signatureBlob ? (
|
||||||
|
// <img
|
||||||
|
// src={`data:${signature?.signatureMimeType || "image/png"};base64,${signature?.signatureBlob}`}
|
||||||
|
// className="h-[50px] w-[250px] object-contain"
|
||||||
|
// alt="Signature"
|
||||||
|
// />
|
||||||
|
// ) : (
|
||||||
|
// <div className="text-gray-400 italic text-sm">No Signature</div>
|
||||||
|
// )}
|
||||||
|
// </div>
|
||||||
|
|
||||||
|
// {/* Name */}
|
||||||
|
// <div className="text-xs text-gray-500 truncate">
|
||||||
|
// {signature?.signatureHash ?? ' '}
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
|
||||||
|
// {/* Initial Column */}
|
||||||
|
// <div className="col-span-5">
|
||||||
|
// <div className="flex flex-col space-y-2 relative ps-6 border-l-3 border-green-600 rounded-bl-2xl rounded-tl-2xl">
|
||||||
|
// <div className="text-sm text-gray-600 font-medium mb-1">
|
||||||
|
// Initials
|
||||||
|
// </div>
|
||||||
|
|
||||||
|
// {/* Initials Image */}
|
||||||
|
// <div className="bg-white rounded-lg p-1 flex items-center justify-center">
|
||||||
|
// {signature?.initialsBlob ? (
|
||||||
|
// <img
|
||||||
|
// src={`data:image/png;base64,${signature?.initialsBlob}`}
|
||||||
|
// className="h-[50px] object-contain"
|
||||||
|
// alt="Initials"
|
||||||
|
// />
|
||||||
|
// ) : (
|
||||||
|
// <div className="text-gray-400 italic text-sm">No Initials</div>
|
||||||
|
// )}
|
||||||
|
// </div>
|
||||||
|
|
||||||
|
// {/* Optional initials hash or font */}
|
||||||
|
// <div className="text-xs text-gray-500 truncate">
|
||||||
|
// {signature?.initialsHash || " "}
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// ))}
|
||||||
|
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// </div>
|
||||||
|
// );
|
||||||
|
|
||||||
|
// default:
|
||||||
|
// return null;
|
||||||
|
// }
|
||||||
|
// };
|
||||||
|
|
||||||
|
|
||||||
|
const renderSignatureText = (type, font, firstName, lastName, mode = 'name') => {
|
||||||
|
if (type !== 'SELECT') return null;
|
||||||
|
|
||||||
|
const selectedFont = signatureOptions.find(opt => opt.style === font);
|
||||||
|
const fontClass = `${selectedFont?.style || 'print'}`;
|
||||||
|
console.log("fontClass",fontClass)
|
||||||
|
|
||||||
|
|
||||||
|
if (mode === 'initials') {
|
||||||
|
const initials = `${(firstName?.[0] ?? '')}${(lastName?.[0] ?? '')}`.toUpperCase();
|
||||||
|
return (
|
||||||
|
<div className={`text-center text-[24px]`} style={{fontFamily:selectedFont?.style}}>
|
||||||
|
{initials}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
const fullName = `${firstName ?? ''} ${lastName ?? ''}`.trim();
|
||||||
|
return (
|
||||||
|
<div className={`text-center text-[20px]`}style={{fontFamily:selectedFont?.style}}>
|
||||||
|
<div>{fullName}</div>
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// Fixed renderContent function for SELECT case with proper radio button styling
|
||||||
const renderContent = () => {
|
const renderContent = () => {
|
||||||
switch (activeTab) {
|
switch (activeTab) {
|
||||||
case 'TYPED':
|
case 'SELECT':
|
||||||
return (
|
return (
|
||||||
<div className="h-full flex flex-col ">
|
<div className="h-full flex flex-col">
|
||||||
<div className="mb-6">
|
<div className="mb-1 md:mb-4 lg:mb-6 flex-shrink-0">
|
||||||
<h2 className="text-xl font-semibold text-gray-900 mb-2">Choose Signature Style</h2>
|
<h2 className="text-base md:text-lg lg:text-xl font-semibold text-gray-900 mb-1">Choose Signature Style</h2>
|
||||||
<p className="text-sm text-gray-600">Select from pre-designed signature styles</p>
|
<p className="text-xs md:text-sm text-gray-600 hidden md:block">Select from pre-designed signature styles</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div className="flex-1 overflow-y-auto">
|
<div className="flex-1 min-h-0 overflow-y-auto no-scrollbar">
|
||||||
<div className="space-y-4">
|
<div className="space-y-2 md:space-y-3 pb-2">
|
||||||
{signatureOptions.map((option) => (
|
{signatureOptions.map((option) => (
|
||||||
<div key={option.id} className="flex items-center space-x-4 px-2 py-1 border border-gray-200 rounded-lg hover:bg-gray-50 transition-colors">
|
<div
|
||||||
|
key={option.id}
|
||||||
|
className={`flex items-center space-x-2 md:space-x-3 p-2 md:p-3 border rounded-lg transition-all duration-200 cursor-pointer ${selectedSignature.id === option.id
|
||||||
|
? 'border-gray-100 shadow-sm'
|
||||||
|
: 'border-gray-200 hover:bg-gray-50 hover:border-gray-300'
|
||||||
|
}`}
|
||||||
|
onClick={() => setSelectedSignature({ id: option.id, style: option.style })}
|
||||||
|
>
|
||||||
|
{/* Custom Radio Button */}
|
||||||
|
<div className="flex-shrink-0">
|
||||||
|
<div
|
||||||
|
className={`w-4 h-4 md:w-3 md:h-3 rounded-full border-2 flex items-center justify-center transition-all duration-200 ${selectedSignature.id === option.id
|
||||||
|
? 'border-gray-300 bg-blue-600'
|
||||||
|
: 'border-gray-300 bg-white hover:border-gray-400'
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{selectedSignature.id === option.id && (
|
||||||
|
<div className="w-2 h-2 md:w-3 md:h-2 rounded-full bg-blue-500"></div>
|
||||||
|
)}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Hidden native radio button for accessibility */}
|
||||||
<input
|
<input
|
||||||
type="radio"
|
type="radio"
|
||||||
id={`signature-${option.id}`}
|
id={`signature-${option.id}`}
|
||||||
name="signature"
|
name="signature"
|
||||||
checked={selectedSignature.id === option.id}
|
checked={selectedSignature.id === option.id}
|
||||||
onChange={() => setSelectedSignature({ id: option.id, style: option.style })}
|
onChange={() => setSelectedSignature({ id: option.id, style: option.style })}
|
||||||
className="w-4 h-4 text-blue-600 focus:ring-blue-500"
|
className="sr-only"
|
||||||
/>
|
/>
|
||||||
<div className="flex-1 grid grid-cols-2 gap-2">
|
|
||||||
<div className=" border-gray-300 rounded-lg px-2 py-1 bg-white ">
|
<div className="flex-1 min-w-0 grid grid-cols-1 md:grid-cols-2 gap-2 md:gap-3">
|
||||||
<div className="text-xs text-gray-500 mb-2">Signed by:</div>
|
<div className="border border-gray-300 rounded-lg px-2 md:px-3 py-2 md:py-3 bg-white min-w-0">
|
||||||
<div className={`text-lg ${option.style === 'cursive' ? 'font-serif italic' :
|
<div className="text-xs text-gray-500 mb-1">Signed by:</div>
|
||||||
|
<div className={`text-sm md:text-base truncate ${option.style === 'cursive' ? 'font-serif italic' :
|
||||||
option.style === 'script' ? 'font-mono' :
|
option.style === 'script' ? 'font-mono' :
|
||||||
option.style === 'elegant' ? 'font-serif' :
|
option.style === 'elegant' ? 'font-serif' :
|
||||||
option.style === 'modern' ? 'font-sans tracking-wide' :
|
option.style === 'modern' ? 'font-sans tracking-wide' :
|
||||||
|
|
@ -354,13 +607,13 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
|
||||||
}`}>
|
}`}>
|
||||||
{fullName || option.name}
|
{fullName || option.name}
|
||||||
</div>
|
</div>
|
||||||
<div className="text-xs text-gray-400 mt-2">
|
<div className="text-xs text-gray-400 mt-1 truncate">
|
||||||
dca3e646-62cd-4cc...
|
dca3e646-62cd-4cc...
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div className=" rounded-lg px-2 py-2 bg-white ">
|
<div className="border border-gray-300 rounded-lg px-2 md:px-3 py-2 md:py-3 bg-white min-w-0">
|
||||||
<div className="text-xs text-gray-500 mb-2">DS</div>
|
<div className="text-xs text-gray-500 mb-1">DS</div>
|
||||||
<div className={`text-2xl ${option.style === 'cursive' ? 'font-serif italic' :
|
<div className={`text-lg md:text-xl truncate ${option.style === 'cursive' ? 'font-serif italic' :
|
||||||
option.style === 'script' ? 'font-mono' :
|
option.style === 'script' ? 'font-mono' :
|
||||||
option.style === 'elegant' ? 'font-serif' :
|
option.style === 'elegant' ? 'font-serif' :
|
||||||
option.style === 'modern' ? 'font-sans tracking-wide' :
|
option.style === 'modern' ? 'font-sans tracking-wide' :
|
||||||
|
|
@ -379,31 +632,33 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
|
||||||
|
|
||||||
case 'DRAW':
|
case 'DRAW':
|
||||||
return (
|
return (
|
||||||
|
<div className="h-full">
|
||||||
<DrawSignatureCanvas
|
<DrawSignatureCanvas
|
||||||
onSignatureChange={handleSignatureChange}
|
onSignatureChange={handleSignatureChange}
|
||||||
// initialSignatures={isEditMode ? signatures : undefined}
|
// initialSignatures={isEditMode ? signatures : undefined}
|
||||||
/>
|
/>
|
||||||
|
</div>
|
||||||
);
|
);
|
||||||
|
|
||||||
case 'UPLOAD':
|
case 'UPLOAD':
|
||||||
return (
|
return (
|
||||||
<div className="h-full flex flex-col">
|
<div className="h-full flex flex-col">
|
||||||
<div className="mb-6">
|
<div className="mb-3 md:mb-4 lg:mb-6 flex-shrink-0">
|
||||||
<h2 className="text-xl font-semibold text-gray-900 mb-2">Upload Signature</h2>
|
<h2 className="text-base md:text-lg lg:text-xl font-semibold text-gray-900 mb-1">Upload Signature</h2>
|
||||||
|
<p className="text-xs md:text-sm text-gray-600 hidden md:block">Upload your signature images</p>
|
||||||
</div>
|
</div>
|
||||||
<div className="flex-1 overflow-y-auto">
|
<div className="flex-1 min-h-0 overflow-y-auto">
|
||||||
<div>
|
<div className="grid grid-cols-1 lg:grid-cols-12 gap-3 md:gap-4 pb-2">
|
||||||
<div className="grid grid-cols-12 gap-6">
|
{/* Upload 1 - Full Signature */}
|
||||||
{/* Upload 1 */}
|
<div className="lg:col-span-8">
|
||||||
<div className="col-span-8">
|
<label className="block text-xs md:text-sm font-medium text-gray-700 mb-2">Full Signature</label>
|
||||||
<label className="block text-sm font-medium text-gray-700 mb-2">Full Signature</label>
|
<label htmlFor="upload1" className="block border-2 border-dashed border-gray-300 rounded-lg h-32 md:h-40 lg:h-48 xl:h-56 flex items-center justify-center bg-gray-50 hover:bg-gray-100 cursor-pointer transition-colors">
|
||||||
<label htmlFor="upload1" className=" border-2 border-dashed border-gray-300 rounded-lg h-62 flex items-center justify-center bg-gray-50 hover:bg-gray-100 cursor-pointer transition-colors">
|
|
||||||
{preview1 ? (
|
{preview1 ? (
|
||||||
<img src={preview1} alt="Signature Preview" className="max-h-44 object-contain" />
|
<img src={preview1} alt="Signature Preview" className="max-h-full max-w-full object-contain p-2" />
|
||||||
) : (
|
) : (
|
||||||
<div className="text-center">
|
<div className="text-center px-4">
|
||||||
<MdCloudUpload className="mx-auto h-12 w-12 text-gray-400 mb-3" />
|
<MdCloudUpload className="mx-auto h-6 w-6 md:h-8 md:w-8 lg:h-10 lg:w-10 text-gray-400 mb-2" />
|
||||||
<p className="text-sm text-gray-500 mb-1">Click to upload or drag and drop</p>
|
<p className="text-xs md:text-sm text-gray-500 mb-1">Click to upload or drag and drop</p>
|
||||||
<p className="text-xs text-gray-400">PNG, JPG, GIF up to 10MB</p>
|
<p className="text-xs text-gray-400">PNG, JPG, GIF up to 10MB</p>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
|
|
@ -417,16 +672,17 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Upload 2 */}
|
{/* Upload 2 - Initials */}
|
||||||
<div className="col-span-4">
|
<div className="lg:col-span-4">
|
||||||
<label className="block text-sm font-medium text-gray-700 mb-2">Initials</label>
|
<label className="block text-xs md:text-sm font-medium text-gray-700 mb-2">Initials</label>
|
||||||
<label htmlFor="upload2" className=" border-2 border-dashed border-gray-300 rounded-lg h-62 flex items-center justify-center bg-gray-50 hover:bg-gray-100 cursor-pointer transition-colors">
|
<label htmlFor="upload2" className="block border-2 border-dashed border-gray-300 rounded-lg h-32 md:h-40 lg:h-48 xl:h-56 flex items-center justify-center bg-gray-50 hover:bg-gray-100 cursor-pointer transition-colors">
|
||||||
{preview2 ? (
|
{preview2 ? (
|
||||||
<img src={preview2} alt="Initials Preview" className="max-h-44 object-contain" />
|
<img src={preview2} alt="Initials Preview" className="max-h-full max-w-full object-contain p-2" />
|
||||||
) : (
|
) : (
|
||||||
<div className="text-center">
|
<div className="text-center px-2">
|
||||||
<MdCloudUpload className="mx-auto h-8 w-8 text-gray-400 mb-2" />
|
<MdCloudUpload className="mx-auto h-5 w-5 md:h-6 md:w-6 lg:h-8 lg:w-8 text-gray-400 mb-2" />
|
||||||
<p className="text-xs text-gray-500">Upload initials</p>
|
<p className="text-xs md:text-sm text-gray-500 mb-1">Upload initials</p>
|
||||||
|
<p className="text-xs text-gray-400 hidden md:block">PNG, JPG, GIF</p>
|
||||||
</div>
|
</div>
|
||||||
)}
|
)}
|
||||||
</label>
|
</label>
|
||||||
|
|
@ -441,8 +697,8 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
|
||||||
);
|
);
|
||||||
|
|
||||||
case 'SAVED':
|
case 'SAVED':
|
||||||
return (
|
return (
|
||||||
<div className="h-full flex flex-col ">
|
<div className="h-full flex flex-col ">
|
||||||
|
|
@ -464,14 +720,14 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
|
||||||
|
|
||||||
{/* Signature Image or Fallback Text */}
|
{/* Signature Image or Fallback Text */}
|
||||||
<div className="bg-white rounded-lg p-1 flex items-center justify-center">
|
<div className="bg-white rounded-lg p-1 flex items-center justify-center">
|
||||||
{signature?.signatureBlob ? (
|
{signature?.signatureType !== 'SELECT' ? (
|
||||||
<img
|
<img
|
||||||
src={`data:${signature?.signatureMimeType || "image/png"};base64,${signature?.signatureBlob}`}
|
src={`data:${signature?.signatureMimeType};base64,${signature?.signatureBlob}`}
|
||||||
className="h-[50px] w-[250px] object-contain"
|
className="h-[50px] w-[250px] object-contain"
|
||||||
alt="Signature"
|
alt="Signature"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="text-gray-400 italic text-sm">No Signature</div>
|
renderSignatureText(signature?.signatureType, signature?.font, signature?.firstName, signature?.lastName, 'name')
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -491,14 +747,14 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
|
||||||
|
|
||||||
{/* Initials Image */}
|
{/* Initials Image */}
|
||||||
<div className="bg-white rounded-lg p-1 flex items-center justify-center">
|
<div className="bg-white rounded-lg p-1 flex items-center justify-center">
|
||||||
{signature?.initialsBlob ? (
|
{signature?.signatureType !== 'SELECT' ? (
|
||||||
<img
|
<img
|
||||||
src={`data:image/png;base64,${signature?.initialsBlob}`}
|
src={`data:${signature.initialsMimeType};base64,${signature.initialsBlob}`}
|
||||||
className="h-[50px] object-contain"
|
className="h-[50px] object-contain"
|
||||||
alt="Initials"
|
alt="Initials"
|
||||||
/>
|
/>
|
||||||
) : (
|
) : (
|
||||||
<div className="text-gray-400 italic text-sm">No Initials</div>
|
renderSignatureText(signature?.signatureType, signature?.font, signature?.firstName, signature?.lastName, 'initials')
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
@ -520,7 +776,6 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
const getUserDetails = async () => {
|
const getUserDetails = async () => {
|
||||||
try {
|
try {
|
||||||
// let res = await axios.get(`/api/user/details`, {
|
// let res = await axios.get(`/api/user/details`, {
|
||||||
|
|
@ -543,24 +798,143 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
|
||||||
}, []);
|
}, []);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className="fixed inset-0 backdrop-blur-sm bg-opacity-50 bg-black/30 flex items-center justify-center z-50 p-4">
|
<div className="fixed inset-0 backdrop-blur-sm bg-opacity-50 bg-black/30 flex items-center justify-center z-50 p-2 md:p-4">
|
||||||
<div className="bg-white rounded-md shadow-xl w-full max-w-[80vw] h-[80vh] flex relative">
|
<div className="bg-white rounded-md shadow-xl w-full h-full md:max-w-[95vw] lg:max-w-[85vw] xl:max-w-[80vw] md:max-h-[95vh] lg:max-h-[90vh] flex flex-col md:flex-row relative overflow-hidden ">
|
||||||
|
|
||||||
{/* Sidebar Navigation */}
|
{/* Mobile Navigation - Fixed at top on mobile only */}
|
||||||
<div className="w-64 bg-gray-50 rounded-l-lg border-r border-gray-200 flex flex-col">
|
<div className="md:hidden flex-1 flex flex-col min-h-0">
|
||||||
{/* Header */}
|
|
||||||
<div className="px-4 py-4 border-b border-gray-200">
|
{/* Scrollable area (mobile: inputs + nav + content) */}
|
||||||
<div className="flex items-center space-x-3">
|
<div className="flex-1 min-h-0 overflow-y-auto no-scrollbar">
|
||||||
<div className='px-1 py-1'>
|
<div className="px-3 lg:px-6 py-2 border-b border-gray-200 flex-shrink-0">
|
||||||
<h3 className="text-md font-semibold text-gray-900">Add Signature Sign</h3>
|
<h3 className="text-sm font-semibold text-gray-900">
|
||||||
<p className="text-xs text-gray-500">Create your digital signature</p>
|
Add Signature
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
{/* Mobile Inputs */}
|
||||||
|
<div className="md:hidden w-full bg-white border-b border-gray-200 flex-shrink-0 px-3 py-2">
|
||||||
|
<div className="grid grid-cols-3 gap-2">
|
||||||
|
<div className='col-span-2'>
|
||||||
|
<label className="block text-xs font-medium text-gray-700 mb-1">
|
||||||
|
Full Name
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
value={fullName}
|
||||||
|
onChange={(e) => setFullName(e.target.value)}
|
||||||
|
placeholder="Enter full name"
|
||||||
|
className="w-full px-2 py-2 text-xs border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className='col-span-1'>
|
||||||
|
<label className="block text-xs font-medium text-gray-700 mb-1">
|
||||||
|
Initials
|
||||||
|
</label>
|
||||||
|
<input
|
||||||
|
type="text"
|
||||||
|
value={initials}
|
||||||
|
onChange={(e) => setInitials(e.target.value)}
|
||||||
|
placeholder="Enter initials"
|
||||||
|
className="w-full px-2 py-2 text-xs border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
||||||
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Form Inputs */}
|
{/* Mobile Navigation - Sticky inside scroll */}
|
||||||
<div className="px-6 py-2.5 border-b border-gray-200">
|
<div className="md:hidden w-full bg-gray-50 border-b border-gray-200 sticky top-0 z-20">
|
||||||
<div className="space-y-2">
|
<div className="px-3 py-1.5">
|
||||||
|
<nav className="flex gap-1">
|
||||||
|
{navigationItems.map((item) => (
|
||||||
|
<button
|
||||||
|
key={item.id}
|
||||||
|
onClick={() => setActiveTab(item.id as 'SELECT' | 'DRAW' | 'UPLOAD')}
|
||||||
|
className={`flex-1 flex items-center justify-center space-x-1 px-2 py-2 text-xs font-medium rounded-lg transition-all duration-200 whitespace-nowrap ${activeTab === item.id
|
||||||
|
? 'bg-blue-50 text-blue-700 border border-blue-200 shadow-sm'
|
||||||
|
: 'text-gray-600 hover:bg-gray-100 hover:text-gray-900'
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
<span className={activeTab === item.id ? 'text-blue-600' : 'text-gray-400'}>
|
||||||
|
{item.icon}
|
||||||
|
</span>
|
||||||
|
<span className="hidden sm:block">{item.label}</span>
|
||||||
|
</button>
|
||||||
|
))}
|
||||||
|
</nav>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Main Content */}
|
||||||
|
<div className="md:hidden p-3 md:p-4 lg:py-5 lg:px-5">
|
||||||
|
<div className="h-full min-h-[300px] md:min-h-[400px]">
|
||||||
|
{renderContent()}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Checkbox - Fixed */}
|
||||||
|
{/* <div className="px-3 md:px-4 lg:px-6 py-2 md:py-3 text-gray-700 border-t border-gray-100 flex-shrink-0">
|
||||||
|
<label className="inline-flex items-center cursor-pointer text-xs md:text-sm hover:text-gray-900 transition-colors">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={checked}
|
||||||
|
onChange={toggleCheckbox}
|
||||||
|
className="sr-only"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
className={`w-3 h-3 md:w-4 md:h-4 border rounded flex items-center justify-center mr-2 md:mr-3 transition-colors flex-shrink-0 ${checked
|
||||||
|
? 'bg-[var(--modalSubmitBG)] border-[var(--modalSubmitBG)]'
|
||||||
|
: 'bg-white border-gray-400 hover:border-gray-500'
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{checked && <FiCheck className="text-white text-xs" />}
|
||||||
|
</div>
|
||||||
|
<span>Signature will be used by default</span>
|
||||||
|
</label>
|
||||||
|
</div> */}
|
||||||
|
|
||||||
|
{/* Footer Buttons - Fixed */}
|
||||||
|
<div className="p-3 md:p-4 lg:p-3 border-t border-gray-200 flex sm:flex-row justify-end gap-2 md:gap-3 flex-shrink-0">
|
||||||
|
<button
|
||||||
|
className="w-full sm:w-auto px-3 md:px-4 lg:px-6 py-2 md:py-3 text-xs md:text-sm font-medium rounded-md border border-gray-300 text-gray-700 hover:bg-gray-50 hover:border-gray-400 disabled:opacity-60 disabled:cursor-not-allowed transition-all duration-200"
|
||||||
|
onClick={() => setOpenSign?.(false)}
|
||||||
|
disabled={isSubmitting}
|
||||||
|
>
|
||||||
|
CANCEL
|
||||||
|
</button>
|
||||||
|
<button
|
||||||
|
className="w-full sm:w-auto px-3 md:px-4 lg:px-6 py-2 md:py-3 text-xs md:text-sm font-medium rounded-md bg-gradient-to-br from-[var(--primary)] to-blue-600 text-white hover:opacity-90 hover:shadow-lg flex items-center justify-center gap-1 md:gap-2 disabled:opacity-60 disabled:cursor-not-allowed transition-all duration-200"
|
||||||
|
onClick={handleSubmit}
|
||||||
|
disabled={isSubmitting}
|
||||||
|
>
|
||||||
|
{isSubmitting ? (
|
||||||
|
<>
|
||||||
|
<FaSpinner className="animate-spin w-3 h-3 md:w-4 md:h-4" />
|
||||||
|
<span>CREATING...</span>
|
||||||
|
</>
|
||||||
|
) : (
|
||||||
|
<span>CREATE SIGNATURE</span>
|
||||||
|
)}
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
{/* Desktop Sidebar Navigation */}
|
||||||
|
<div className="hidden md:flex md:w-64 lg:w-72 xl:w-80 bg-gray-50 md:border-r border-gray-200 flex-col">
|
||||||
|
{/* Header - Fixed */}
|
||||||
|
<div className="px-4 lg:px-6 py-4 border-b border-gray-200 flex-shrink-0">
|
||||||
|
<h3 className="text-sm font-semibold text-gray-900">
|
||||||
|
Add Signature
|
||||||
|
</h3>
|
||||||
|
<p className="text-sm text-gray-500">
|
||||||
|
Create your digital signature
|
||||||
|
</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
{/* Form Inputs - Fixed */}
|
||||||
|
<div className="px-4 lg:px-6 py-4 border-b border-gray-200 flex-shrink-0">
|
||||||
|
<div className="grid grid-cols-1 gap-3">
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm font-medium text-gray-700 mb-2">
|
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||||
Full Name
|
Full Name
|
||||||
|
|
@ -570,10 +944,9 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
|
||||||
value={fullName}
|
value={fullName}
|
||||||
onChange={(e) => setFullName(e.target.value)}
|
onChange={(e) => setFullName(e.target.value)}
|
||||||
placeholder="Enter full name"
|
placeholder="Enter full name"
|
||||||
className="w-full px-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
className="w-full px-3 py-2 text-sm border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<label className="block text-sm font-medium text-gray-700 mb-2">
|
<label className="block text-sm font-medium text-gray-700 mb-2">
|
||||||
Initials
|
Initials
|
||||||
|
|
@ -583,79 +956,89 @@ const AddSignatureModal: React.FC<AddSignatureModalProps> = ({
|
||||||
value={initials}
|
value={initials}
|
||||||
onChange={(e) => setInitials(e.target.value)}
|
onChange={(e) => setInitials(e.target.value)}
|
||||||
placeholder="Enter initials"
|
placeholder="Enter initials"
|
||||||
className="w-full px-3 py-2 text-sm border border-gray-300 rounded-md focus:outline-none focus:ring-2 focus:ring-blue-500 focus:border-transparent"
|
className="w-full px-3 py-2 text-sm border border-gray-300 rounded-md focus:ring-2 focus:ring-blue-500 focus:border-blue-500"
|
||||||
/>
|
/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Navigation Menu */}
|
{/* Navigation Menu - Fixed */}
|
||||||
<div className="flex-1 px-6 py-2.5">
|
<div className="px-4 lg:px-6 py-4 flex-shrink-0">
|
||||||
<nav className="space-y-2">
|
<nav className="flex flex-col gap-2">
|
||||||
{navigationItems.map((item) => (
|
{navigationItems.map((item) => (
|
||||||
<button
|
<button
|
||||||
key={item.id}
|
key={item.id}
|
||||||
onClick={() => setActiveTab(item.id as 'TYPED' | 'DRAW' | 'UPLOAD' | 'SAVED')}
|
onClick={() => setActiveTab(item.id as 'SELECT' | 'DRAW' | 'UPLOAD')}
|
||||||
className={`w-full flex items-center space-x-3 px-2 py-2 text-sm font-medium rounded-lg cursor-pointer transition-colors ${activeTab === item.id
|
className={`w-full flex items-center justify-start space-x-2 px-3 py-3 text-sm font-medium rounded-lg transition-all duration-200 whitespace-nowrap ${activeTab === item.id
|
||||||
? 'bg-blue-50 text-blue-700 border border-blue-200'
|
? 'bg-blue-50 text-blue-700 border border-blue-200 shadow-sm'
|
||||||
: 'text-gray-600 hover:bg-gray-100 hover:text-gray-900'
|
: 'text-gray-600 hover:bg-gray-100 hover:text-gray-900'
|
||||||
}`}
|
}`}
|
||||||
>
|
>
|
||||||
<span className={activeTab === item.id ? 'text-blue-600' : 'text-gray-400'}>
|
<span className={activeTab === item.id ? 'text-blue-600' : 'text-gray-400'}>
|
||||||
{item.icon}
|
{item.icon}
|
||||||
</span>
|
</span>
|
||||||
|
|
||||||
<span>{item.label}</span>
|
<span>{item.label}</span>
|
||||||
</button>
|
</button>
|
||||||
))}
|
))}
|
||||||
</nav>
|
</nav>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{/* Spacer for desktop */}
|
||||||
|
<div className="flex-1"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
{/* Main Content Area */}
|
{/* Main Content Area */}
|
||||||
<div className="flex-1 flex flex-col ">
|
<div className="hidden flex-1 md:flex flex-col min-h-0">
|
||||||
{/* Header with close button */}
|
{/* Content - Scrollable */}
|
||||||
|
<div className="flex-1 min-h-0 p-3 md:p-4 lg:py-5 lg:px-5 overflow-y-auto no-scrollbar">
|
||||||
{/* Content */}
|
<div className="h-full min-h-[300px] md:min-h-[400px]">
|
||||||
<div className="flex-1 py-5 px-5 overflow-hidden ">
|
|
||||||
{/* <button
|
|
||||||
onClick={() => setShowAddSignature?.(false)}
|
|
||||||
className="absolute top-2 right-3 p-2 hover:bg-gray-100 rounded-full transition-colors z-20"
|
|
||||||
>
|
|
||||||
<AiOutlineClose className="w-5 h-5 text-gray-500" />
|
|
||||||
</button> */}
|
|
||||||
{renderContent()}
|
{renderContent()}
|
||||||
</div>
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
{/* Footer Buttons in Main Area */}
|
{/* Checkbox - Fixed */}
|
||||||
<div className="p-4 border-t border-gray-200 flex justify-end gap-3">
|
{/* <div className="px-3 md:px-4 lg:px-6 py-2 md:py-3 text-gray-700 border-t border-gray-100 flex-shrink-0">
|
||||||
|
<label className="inline-flex items-center cursor-pointer text-xs md:text-sm hover:text-gray-900 transition-colors">
|
||||||
|
<input
|
||||||
|
type="checkbox"
|
||||||
|
checked={checked}
|
||||||
|
onChange={toggleCheckbox}
|
||||||
|
className="sr-only"
|
||||||
|
/>
|
||||||
|
<div
|
||||||
|
className={`w-3 h-3 md:w-4 md:h-4 border rounded flex items-center justify-center mr-2 md:mr-3 transition-colors flex-shrink-0 ${checked ? 'bg-[var(--modalSubmitBG)] border-[var(--modalSubmitBG)]' : 'bg-white border-gray-400 hover:border-gray-500'
|
||||||
|
}`}
|
||||||
|
>
|
||||||
|
{checked && <FiCheck className="text-white text-xs" />}
|
||||||
|
</div>
|
||||||
|
<span>Signature will be used by default</span>
|
||||||
|
</label>
|
||||||
|
</div> */}
|
||||||
|
|
||||||
|
{/* Footer Buttons - Fixed */}
|
||||||
|
<div className="p-3 md:p-4 lg:p-3 border-t border-gray-200 flex sm:flex-row justify-end gap-2 md:gap-3 flex-shrink-0">
|
||||||
<button
|
<button
|
||||||
className="cursor-pointer px-4 py-2 text-sm font-medium rounded-md border border-gray-300 text-gray-700 hover:bg-gray-50 transition-colors disabled:opacity-60 disabled:cursor-not-allowed"
|
className="w-full sm:w-auto px-3 md:px-4 lg:px-6 py-2 md:py-3 text-xs md:text-sm font-medium rounded-md border border-gray-300 text-gray-700 hover:bg-gray-50 hover:border-gray-400 disabled:opacity-60 disabled:cursor-not-allowed transition-all duration-200"
|
||||||
onClick={() => setOpenSign?.(false)}
|
onClick={() => setOpenSign?.(false)}
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
>
|
>
|
||||||
CANCEL
|
CANCEL
|
||||||
</button>
|
</button>
|
||||||
<button
|
<button
|
||||||
className="cursor-pointer px-4 py-2 text-sm font-medium rounded-md bg-[var(--modalSubmitBG)] text-white hover:bg-[var(--modalSubmitBGHover)] transition-colors flex items-center gap-2 disabled:opacity-60 disabled:cursor-not-allowed"
|
className="w-full sm:w-auto px-3 md:px-4 lg:px-6 py-2 md:py-3 text-xs md:text-sm font-medium rounded-md bg-gradient-to-br from-[var(--primary)] to-blue-600 text-white hover:opacity-90 hover:shadow-lg flex items-center justify-center gap-1 md:gap-2 disabled:opacity-60 disabled:cursor-not-allowed transition-all duration-200"
|
||||||
onClick={handleSubmit}
|
onClick={handleSubmit}
|
||||||
disabled={isSubmitting}
|
disabled={isSubmitting}
|
||||||
>
|
>
|
||||||
{isSubmitting ? (
|
{isSubmitting ? (
|
||||||
<>
|
<>
|
||||||
<FaSpinner className="animate-spin" />
|
<FaSpinner className="animate-spin w-3 h-3 md:w-4 md:h-4" />
|
||||||
{/* {isEditMode ? 'UPDATING...' : 'CREATING...'} */}
|
<span>CREATING...</span>
|
||||||
</>
|
</>
|
||||||
) : (
|
) : (
|
||||||
<>
|
<span>CREATE SIGNATURE</span>
|
||||||
{activeTab === "SAVED" ? "CHANGE SIGNATURE" : "CREATE SIGNATURE"}
|
|
||||||
{/* isEditMode ? 'UPDATE SIGNATURE' : 'CREATE SIGNATURE' */}
|
|
||||||
</>
|
|
||||||
)}
|
)}
|
||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue