misc_pterodactyl-panel/resources/scripts/components/elements/dialog/DialogFooter.tsx
2022-07-03 13:29:23 -04:00

15 lines
495 B
TypeScript

import React, { useContext } from 'react';
import { DialogContext } from './';
import { useDeepCompareEffect } from '@/plugins/useDeepCompareEffect';
export default ({ children }: { children: React.ReactNode }) => {
const { setFooter } = useContext(DialogContext);
useDeepCompareEffect(() => {
setFooter(
<div className={'px-6 py-3 bg-gray-700 flex items-center justify-end space-x-3 rounded-b'}>{children}</div>
);
}, [children]);
return null;
};