This repository has been archived on 2025-05-09. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
Astral-nook/resources/scripts/components/elements/dialog/DialogFooter.tsx

17 lines
526 B
TypeScript

import React, { useContext } from 'react';
import { createPortal } from 'react-dom';
import DialogContext from '@/components/elements/dialog/context';
export default ({ children }: { children: React.ReactNode }) => {
const { buttons } = useContext(DialogContext);
if (!buttons.current) {
return null;
}
const element = (
<div className={'px-6 py-3 bg-gray-700 flex items-center justify-end space-x-3 rounded-b'}>{children}</div>
);
return createPortal(element, buttons.current);
};