2022-02-04 16:55:57 -08:00
|
|
|
import React, { useEffect } from "react";
|
|
|
|
import { Modal, ModalContent } from "../Modal";
|
|
|
|
import { Button } from "../button";
|
|
|
|
import { FieldRow, ErrorMessage } from "../input/Input";
|
|
|
|
import { useSubmitRageshake } from "../settings/rageshake";
|
|
|
|
import { Body } from "../typography/Typography";
|
|
|
|
|
2022-02-23 15:52:53 -08:00
|
|
|
export function RageshakeRequestModal({ rageshakeRequestId, roomId, ...rest }) {
|
2022-02-04 16:55:57 -08:00
|
|
|
const { submitRageshake, sending, sent, error } = useSubmitRageshake();
|
|
|
|
|
|
|
|
useEffect(() => {
|
|
|
|
if (sent) {
|
2022-02-07 15:24:43 -08:00
|
|
|
rest.onClose();
|
2022-02-04 16:55:57 -08:00
|
|
|
}
|
2022-02-07 15:24:43 -08:00
|
|
|
}, [sent, rest.onClose]);
|
2022-02-04 16:55:57 -08:00
|
|
|
|
|
|
|
return (
|
2022-02-07 15:24:43 -08:00
|
|
|
<Modal title="Debug Log Request" isDismissable {...rest}>
|
2022-02-04 16:55:57 -08:00
|
|
|
<ModalContent>
|
|
|
|
<Body>
|
|
|
|
Another user on this call is having an issue. In order to better
|
|
|
|
diagnose these issues we'd like to collect a debug log.
|
|
|
|
</Body>
|
|
|
|
<FieldRow>
|
|
|
|
<Button
|
2022-02-07 15:24:43 -08:00
|
|
|
onPress={() =>
|
|
|
|
submitRageshake({
|
|
|
|
sendLogs: true,
|
|
|
|
rageshakeRequestId,
|
2022-02-23 15:52:53 -08:00
|
|
|
roomId,
|
2022-02-07 15:24:43 -08:00
|
|
|
})
|
|
|
|
}
|
2022-02-04 16:55:57 -08:00
|
|
|
disabled={sending}
|
|
|
|
>
|
|
|
|
{sending ? "Sending debug log..." : "Send debug log"}
|
|
|
|
</Button>
|
|
|
|
</FieldRow>
|
|
|
|
{error && (
|
|
|
|
<FieldRow>
|
|
|
|
<ErrorMessage>{error.message}</ErrorMessage>
|
|
|
|
</FieldRow>
|
|
|
|
)}
|
|
|
|
</ModalContent>
|
|
|
|
</Modal>
|
|
|
|
);
|
|
|
|
}
|