2022-07-02 17:24:12 -04:00
|
|
|
import React, { useContext } from 'react';
|
2022-07-03 13:29:23 -04:00
|
|
|
import { DialogContext } from './';
|
2022-07-02 18:27:22 -04:00
|
|
|
import { useDeepCompareEffect } from '@/plugins/useDeepCompareEffect';
|
2022-07-02 17:24:12 -04:00
|
|
|
|
|
|
|
export default ({ children }: { children: React.ReactNode }) => {
|
2022-07-02 18:27:22 -04:00
|
|
|
const { setFooter } = useContext(DialogContext);
|
2022-07-02 17:24:12 -04:00
|
|
|
|
2022-07-02 18:27:22 -04:00
|
|
|
useDeepCompareEffect(() => {
|
|
|
|
setFooter(
|
|
|
|
<div className={'px-6 py-3 bg-gray-700 flex items-center justify-end space-x-3 rounded-b'}>{children}</div>
|
|
|
|
);
|
|
|
|
}, [children]);
|
2022-07-02 17:24:12 -04:00
|
|
|
|
2022-07-02 18:27:22 -04:00
|
|
|
return null;
|
2022-07-02 17:24:12 -04:00
|
|
|
};
|