mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: replace React.FC<Props> with simple function component (#54123)
This commit is contained in:
@@ -58,7 +58,7 @@ const getCopiedPanelPlugins = () => {
|
||||
return sortBy(copiedPanels, 'sort');
|
||||
};
|
||||
|
||||
export const AddPanelWidgetUnconnected: React.FC<Props> = ({ panel, dashboard }) => {
|
||||
export const AddPanelWidgetUnconnected = ({ panel, dashboard }: Props) => {
|
||||
const [addPanelView, setAddPanelView] = useState(false);
|
||||
|
||||
const onCancelAddPanel = (evt: React.MouseEvent<HTMLButtonElement>) => {
|
||||
|
||||
@@ -19,7 +19,7 @@ type Props = {
|
||||
|
||||
export const newAnnotationName = 'New annotation';
|
||||
|
||||
export const AnnotationSettingsEdit: React.FC<Props> = ({ editIdx, dashboard }) => {
|
||||
export const AnnotationSettingsEdit = ({ editIdx, dashboard }: Props) => {
|
||||
const [annotation, setAnnotation] = useState(dashboard.annotations.list[editIdx]);
|
||||
|
||||
const { value: ds } = useAsync(() => {
|
||||
|
||||
@@ -14,7 +14,7 @@ type Props = {
|
||||
onEdit: (idx: number) => void;
|
||||
};
|
||||
|
||||
export const AnnotationSettingsList: React.FC<Props> = ({ dashboard, onNew, onEdit }) => {
|
||||
export const AnnotationSettingsList = ({ dashboard, onNew, onEdit }: Props) => {
|
||||
const [annotations, updateAnnotations] = useState(dashboard.annotations.list);
|
||||
|
||||
const onMove = (idx: number, direction: number) => {
|
||||
|
||||
@@ -24,7 +24,7 @@ const connector = connect(null, mapDispatchToProps);
|
||||
|
||||
type Props = DeleteDashboardModalProps & ConnectedProps<typeof connector>;
|
||||
|
||||
const DeleteDashboardModalUnconnected: React.FC<Props> = ({ hideModal, cleanUpDashboardAndVariables, dashboard }) => {
|
||||
const DeleteDashboardModalUnconnected = ({ hideModal, cleanUpDashboardAndVariables, dashboard }: Props) => {
|
||||
const isProvisioned = dashboard.meta.provisioned;
|
||||
const { onDeleteDashboard } = useDashboardDelete(dashboard.uid, cleanUpDashboardAndVariables);
|
||||
|
||||
|
||||
@@ -31,7 +31,7 @@ interface Props {
|
||||
onClose: () => void;
|
||||
}
|
||||
|
||||
export const InspectContent: React.FC<Props> = ({
|
||||
export const InspectContent = ({
|
||||
panel,
|
||||
plugin,
|
||||
dashboard,
|
||||
@@ -43,7 +43,7 @@ export const InspectContent: React.FC<Props> = ({
|
||||
defaultTab,
|
||||
onDataOptionsChange,
|
||||
onClose,
|
||||
}) => {
|
||||
}: Props) => {
|
||||
const [currentTab, setCurrentTab] = useState(defaultTab ?? InspectTab.Data);
|
||||
|
||||
if (!plugin) {
|
||||
|
||||
@@ -26,7 +26,7 @@ export interface ConnectedProps {
|
||||
|
||||
export type Props = OwnProps & ConnectedProps;
|
||||
|
||||
const PanelInspectorUnconnected: React.FC<Props> = ({ panel, dashboard, plugin }) => {
|
||||
const PanelInspectorUnconnected = ({ panel, dashboard, plugin }: Props) => {
|
||||
const [dataOptions, setDataOptions] = useState<GetDataOptions>({
|
||||
withTransforms: false,
|
||||
withFieldConfig: true,
|
||||
|
||||
@@ -18,7 +18,7 @@ interface Props {
|
||||
dashboardId: number;
|
||||
}
|
||||
|
||||
export const DashboardLinksDashboard: React.FC<Props> = (props) => {
|
||||
export const DashboardLinksDashboard = (props: Props) => {
|
||||
const { link, linkInfo } = props;
|
||||
const listRef = useRef<HTMLUListElement>(null);
|
||||
const [dropdownCssClass, setDropdownCssClass] = useState('invisible');
|
||||
|
||||
Reference in New Issue
Block a user