misc_pterodactyl-panel/resources/scripts/components/elements/dialog/DialogFooter.tsx

17 lines
521 B
TypeScript
Raw Normal View History

2022-11-25 20:25:03 +00:00
import { useContext } from 'react';
import * as React from 'react';
import { DialogContext } from './';
2022-07-02 22:27:22 +00:00
import { useDeepCompareEffect } from '@/plugins/useDeepCompareEffect';
export default ({ children }: { children: React.ReactNode }) => {
2022-07-02 22:27:22 +00:00
const { setFooter } = useContext(DialogContext);
2022-07-02 22:27:22 +00:00
useDeepCompareEffect(() => {
setFooter(
2022-11-25 20:25:03 +00:00
<div className={'px-6 py-3 bg-gray-700 flex items-center justify-end space-x-3 rounded-b'}>{children}</div>,
2022-07-02 22:27:22 +00:00
);
}, [children]);
2022-07-02 22:27:22 +00:00
return null;
};