mirror of
https://github.com/documenso/documenso.git
synced 2025-11-13 08:13:56 +10:00
fix lint, description of dialog
Signed-off-by: harkiratsm <multaniharry714@gmail.com>
This commit is contained in:
@ -1,50 +1,55 @@
|
||||
import React from 'react';
|
||||
|
||||
import { Button } from './button';
|
||||
import {
|
||||
Dialog,
|
||||
DialogContent,
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
DialogDescription,
|
||||
DialogFooter,
|
||||
} from './dialog';
|
||||
|
||||
import { Input } from './input';
|
||||
import { Button } from './button';
|
||||
DialogHeader,
|
||||
DialogTitle,
|
||||
} from './dialog';
|
||||
import { Input } from './input';
|
||||
|
||||
type PasswordDialogProps = {
|
||||
open: boolean;
|
||||
onOpenChange: (_open: boolean) => void;
|
||||
setPassword: (_password: string) => void;
|
||||
handleSubmit: () => void;
|
||||
onPasswordSubmit: () => void;
|
||||
isError?: boolean;
|
||||
}
|
||||
};
|
||||
|
||||
export const PasswordDialog = ({ open, onOpenChange, handleSubmit, isError, setPassword }: PasswordDialogProps) => {
|
||||
export const PasswordDialog = ({
|
||||
open,
|
||||
onOpenChange,
|
||||
onPasswordSubmit,
|
||||
isError,
|
||||
setPassword,
|
||||
}: PasswordDialogProps) => {
|
||||
return (
|
||||
<Dialog open={open} onOpenChange={onOpenChange}>
|
||||
<DialogContent className="max-w-md">
|
||||
<DialogHeader>
|
||||
<DialogTitle>Password Required</DialogTitle>
|
||||
<DialogDescription>
|
||||
{isError ? (
|
||||
<span className="text-red-500">Incorrect password. Please try again.</span>
|
||||
) : (
|
||||
<span className="text-muted-foreground">
|
||||
This document is password protected. Please enter the password to view the document.
|
||||
</span>
|
||||
)}
|
||||
<DialogDescription className="text-muted-foreground">
|
||||
This document is password protected. Please enter the password to view the document.
|
||||
</DialogDescription>
|
||||
</DialogHeader>
|
||||
<DialogFooter className="flex w-full items-center justify-center gap-4">
|
||||
<Input
|
||||
type="password"
|
||||
className="bg-background mt-1.5"
|
||||
placeholder='Enter password'
|
||||
placeholder="Enter password"
|
||||
onChange={(e) => setPassword(e.target.value)}
|
||||
autoComplete="off"
|
||||
/>
|
||||
<Button onClick={handleSubmit}>Submit</Button>
|
||||
<Button onClick={onPasswordSubmit}>Submit</Button>
|
||||
</DialogFooter>
|
||||
{isError && (
|
||||
<span className="text-xs text-red-500">
|
||||
The password you entered is incorrect. Please try again.
|
||||
</span>
|
||||
)}
|
||||
</DialogContent>
|
||||
</Dialog>
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user