roles-dialogs.tsx 574 B

1234567891011121314151617181920212223
  1. import { RolesActionDialog } from './roles-action-dialog'
  2. import { RolesDeleteDialog } from './roles-delete-dialog'
  3. import { useRolesContext } from './roles-provider'
  4. export function RolesDialogs() {
  5. const { open, setOpen, currentRow, setCurrentRow } = useRolesContext()
  6. return (
  7. <>
  8. <RolesActionDialog />
  9. <RolesDeleteDialog
  10. open={open === 'delete'}
  11. onOpenChange={(state) => {
  12. if (!state) {
  13. setOpen(null)
  14. setCurrentRow(null)
  15. }
  16. }}
  17. currentRow={currentRow}
  18. />
  19. </>
  20. )
  21. }