Summary: Make it optional to display the icon (glyph) with a default of true. Not used in this diff, but it will in future diffs. Reviewed By: ivanmisuno Differential Revision: D43186605 fbshipit-source-id: b525e126bcc46604e0abc0f83b6ff33a7ce78962
37 lines
787 B
TypeScript
37 lines
787 B
TypeScript
/**
|
|
* Copyright (c) Meta Platforms, Inc. and 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';
|
|
// eslint-disable-next-line rulesdir/no-restricted-imports-clone
|
|
import {Glyph} from 'flipper';
|
|
import {theme} from 'flipper-plugin';
|
|
|
|
type NoDataProps = {
|
|
message: string;
|
|
displayIcon?: boolean;
|
|
};
|
|
export const NoData: React.FC<NoDataProps> = ({
|
|
message,
|
|
displayIcon = true,
|
|
}) => {
|
|
return (
|
|
<div style={{textAlign: 'center'}}>
|
|
{displayIcon && (
|
|
<Glyph
|
|
name="stop"
|
|
size={24}
|
|
style={{margin: 20}}
|
|
color={theme.primaryColor}
|
|
/>
|
|
)}
|
|
<p>{message}</p>
|
|
</div>
|
|
);
|
|
};
|