-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Expand file tree
/
Copy pathFormButtons.tsx
More file actions
35 lines (34 loc) · 823 Bytes
/
FormButtons.tsx
File metadata and controls
35 lines (34 loc) · 823 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { cn } from "~/utils/cn";
export function FormButtons({
cancelButton,
confirmButton,
defaultAction,
className,
}: {
cancelButton?: React.ReactNode;
confirmButton: React.ReactNode;
defaultAction?: { name: string; value: string; disabled?: boolean };
className?: string;
}) {
return (
<div
className={cn(
"flex w-full items-center justify-between border-t border-grid-bright pt-4",
className
)}
>
{defaultAction && (
<button
type="submit"
name={defaultAction.name}
value={defaultAction.value}
disabled={defaultAction.disabled}
className="hidden"
tabIndex={-1}
aria-hidden="true"
/>
)}
{cancelButton ? cancelButton : <div />} {confirmButton}
</div>
);
}