/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import React from 'react';
import {Button, Typography} from 'antd';
import {CoffeeOutlined, CopyOutlined, DeleteOutlined} from '@ant-design/icons';
import {
usePlugin,
useValue,
DataList,
Layout,
CodeBlock,
Toolbar,
} from 'flipper-plugin';
import {Crash, devicePlugin} from './index';
const {Text} = Typography;
export function Crashes() {
const plugin = usePlugin(devicePlugin);
const crashes = useValue(plugin.crashes);
const selectedCrashId = useValue(plugin.selectedCrash);
const selectedCrash = crashes.find(
(c) => c.notificationID === selectedCrashId,
);
return (
);
}
function CrashDetails({crash}: {crash: Crash}) {
const plugin = usePlugin(devicePlugin);
return (
{
plugin.clearCrashes();
}}
title="Clear all crashes"
danger>
}>
{plugin.isFB ? (
) : null}
{crash.name}
{crash.reason}
{crash.callstack}
);
}