mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Chore: Avoid explicit React.FC<Props> when possible (round 2) (#64749)
This commit is contained in:
@@ -13,7 +13,7 @@ interface SaveDashboardButtonProps {
|
||||
size?: ComponentSize;
|
||||
}
|
||||
|
||||
export const SaveDashboardButton: React.FC<SaveDashboardButtonProps> = ({ dashboard, onSaveSuccess, size }) => {
|
||||
export const SaveDashboardButton = ({ dashboard, onSaveSuccess, size }: SaveDashboardButtonProps) => {
|
||||
return (
|
||||
<ModalsController>
|
||||
{({ showModal, hideModal }) => {
|
||||
@@ -37,12 +37,9 @@ export const SaveDashboardButton: React.FC<SaveDashboardButtonProps> = ({ dashbo
|
||||
);
|
||||
};
|
||||
|
||||
export const SaveDashboardAsButton: React.FC<SaveDashboardButtonProps & { variant?: ButtonVariant }> = ({
|
||||
dashboard,
|
||||
onSaveSuccess,
|
||||
variant,
|
||||
size,
|
||||
}) => {
|
||||
type Props = SaveDashboardButtonProps & { variant?: ButtonVariant };
|
||||
|
||||
export const SaveDashboardAsButton = ({ dashboard, onSaveSuccess, variant, size }: Props) => {
|
||||
return (
|
||||
<ModalsController>
|
||||
{({ showModal, hideModal }) => {
|
||||
|
||||
@@ -19,12 +19,12 @@ interface SaveDashboardErrorProxyProps {
|
||||
onDismiss: () => void;
|
||||
}
|
||||
|
||||
export const SaveDashboardErrorProxy: React.FC<SaveDashboardErrorProxyProps> = ({
|
||||
export const SaveDashboardErrorProxy = ({
|
||||
dashboard,
|
||||
dashboardSaveModel,
|
||||
error,
|
||||
onDismiss,
|
||||
}) => {
|
||||
}: SaveDashboardErrorProxyProps) => {
|
||||
const { onDashboardSave } = useDashboardSave(dashboard);
|
||||
|
||||
useEffect(() => {
|
||||
|
||||
@@ -14,12 +14,7 @@ interface UnsavedChangesModalProps {
|
||||
onSaveSuccess?: () => void;
|
||||
}
|
||||
|
||||
export const UnsavedChangesModal: React.FC<UnsavedChangesModalProps> = ({
|
||||
dashboard,
|
||||
onSaveSuccess,
|
||||
onDiscard,
|
||||
onDismiss,
|
||||
}) => {
|
||||
export const UnsavedChangesModal = ({ dashboard, onSaveSuccess, onDiscard, onDismiss }: UnsavedChangesModalProps) => {
|
||||
return (
|
||||
<Modal
|
||||
isOpen={true}
|
||||
|
||||
@@ -38,13 +38,7 @@ export interface SaveDashboardAsFormProps extends SaveDashboardFormProps {
|
||||
isNew?: boolean;
|
||||
}
|
||||
|
||||
export const SaveDashboardAsForm: React.FC<SaveDashboardAsFormProps> = ({
|
||||
dashboard,
|
||||
isNew,
|
||||
onSubmit,
|
||||
onCancel,
|
||||
onSuccess,
|
||||
}) => {
|
||||
export const SaveDashboardAsForm = ({ dashboard, isNew, onSubmit, onCancel, onSuccess }: SaveDashboardAsFormProps) => {
|
||||
const defaultValues: SaveDashboardAsFormDTO = {
|
||||
title: isNew ? dashboard.title : `${dashboard.title} Copy`,
|
||||
$folder: {
|
||||
|
||||
@@ -7,7 +7,7 @@ import { Button, ClipboardButton, HorizontalGroup, TextArea } from '@grafana/ui'
|
||||
|
||||
import { SaveDashboardFormProps } from '../types';
|
||||
|
||||
export const SaveProvisionedDashboardForm: React.FC<SaveDashboardFormProps> = ({ dashboard, onCancel }) => {
|
||||
export const SaveProvisionedDashboardForm = ({ dashboard, onCancel }: SaveDashboardFormProps) => {
|
||||
const [dashboardJSON, setDashboardJson] = useState(() => {
|
||||
const clone = dashboard.getSaveModelClone();
|
||||
delete clone.id;
|
||||
|
||||
Reference in New Issue
Block a user