Add update button and tooltips to IconButtons

This commit is contained in:
Sacha Weatherstone
2022-02-19 23:34:07 +11:00
parent 9f7561dac0
commit 60f2b0d999
4 changed files with 48 additions and 22 deletions
+6 -1
View File
@@ -11,12 +11,14 @@ import { Card } from './Card';
export interface ModalProps {
title: string;
onClose: () => void;
actions?: React.ReactNode;
children: React.ReactNode;
}
export const Modal = ({
title,
onClose,
actions,
children,
}: ModalProps): JSX.Element => {
const darkMode = useAppSelector((state) => state.app.darkMode);
@@ -43,7 +45,10 @@ export const Modal = ({
<div className="text-2xl font-medium dark:text-white">
{title}
</div>
<IconButton icon={<FiX />} onClick={onClose} />
<div className="flex gap-2">
{actions}
<IconButton tooltip="Close" icon={<FiX />} onClick={onClose} />
</div>
</div>
{children}
</Card>