refactor: Création de composants et uniformisation des modales (#2)

This commit is contained in:
N3WT DE COMPET
2024-11-24 18:42:42 +01:00
parent 5946cbdee6
commit d51778ba54
18 changed files with 362 additions and 299 deletions

View File

@ -1,4 +1,5 @@
import * as Dialog from '@radix-ui/react-dialog';
import Button from '@/components/Button';
const Modal = ({ isOpen, setIsOpen, title, ContentComponent, size }) => {
return (
@ -13,14 +14,14 @@ const Modal = ({ isOpen, setIsOpen, title, ContentComponent, size }) => {
<div className="mt-2">
<ContentComponent />
</div>
<div className="mt-4 flex justify-end">
<div className="mt-4 flex justify-end space-x-4">
<Dialog.Close asChild>
<button
className="px-4 py-2 rounded-md shadow-sm focus:outline-none bg-gray-300 text-gray-700 hover:bg-gray-400"
<Button text="Fermer"
onClick={() => setIsOpen(false)}
>
Fermer
</button>
className="px-4 py-2 rounded-md shadow-sm focus:outline-none bg-gray-300 text-gray-700 hover:bg-gray-400"
secondary
type="submit"
name="Create" />
</Dialog.Close>
</div>
</div>