mirror of
https://github.com/alexmickelson/canvasManagement.git
synced 2026-03-26 07:38:33 -06:00
beter add button
This commit is contained in:
@@ -25,22 +25,28 @@ export function useModal() {
|
||||
|
||||
export default function Modal({
|
||||
children,
|
||||
buttonText,
|
||||
buttonText = "",
|
||||
buttonClass = "",
|
||||
modalWidth = "w-1/3",
|
||||
modalControl,
|
||||
buttonComponent,
|
||||
}: {
|
||||
children: (props: { closeModal: () => void }) => ReactNode;
|
||||
buttonText: string;
|
||||
buttonText?: string;
|
||||
buttonClass?: string;
|
||||
modalWidth?: string;
|
||||
modalControl: ModalControl;
|
||||
buttonComponent?: (props: { openModal: () => void }) => ReactNode;
|
||||
}) {
|
||||
return (
|
||||
<>
|
||||
<button onClick={modalControl.openModal} className={buttonClass}>
|
||||
{buttonText}
|
||||
</button>
|
||||
{buttonComponent ? (
|
||||
buttonComponent({ openModal: modalControl.openModal })
|
||||
) : (
|
||||
<button onClick={modalControl.openModal} className={buttonClass}>
|
||||
{buttonText}
|
||||
</button>
|
||||
)}
|
||||
|
||||
<div
|
||||
className={
|
||||
|
||||
Reference in New Issue
Block a user