Initialize League GUI prototype
This commit is contained in:
29
src/components/ui/Modal.tsx
Normal file
29
src/components/ui/Modal.tsx
Normal file
@@ -0,0 +1,29 @@
|
||||
import type { ReactNode } from "react";
|
||||
import { Button } from "./Button";
|
||||
|
||||
type ModalProps = {
|
||||
open: boolean;
|
||||
title: string;
|
||||
children: ReactNode;
|
||||
onClose: () => void;
|
||||
};
|
||||
|
||||
export function Modal({ open, title, children, onClose }: ModalProps) {
|
||||
if (!open) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<div className="ui-modal-backdrop" role="presentation">
|
||||
<section className="ui-modal" role="dialog" aria-modal="true" aria-labelledby="modal-title">
|
||||
<header className="ui-modal-header">
|
||||
<h2 id="modal-title">{title}</h2>
|
||||
<Button variant="ghost" size="sm" onClick={onClose} aria-label="Close modal">
|
||||
Close
|
||||
</Button>
|
||||
</header>
|
||||
<div>{children}</div>
|
||||
</section>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user