import * as React from 'react'; import { Button, ButtonVariant, Form, FormGroup, ModalVariant, Flex, TextInput, } from '@patternfly/react-core'; import { ComponentProps, createModalLauncher } from '~/shared/components/modal/createModalLauncher'; type SavedViewRenameModalProps = ComponentProps & { currentLabel: string; onRename: (newLabel: string) => void; }; export const SavedViewRenameModal: React.FC = ({ onClose, currentLabel, onRename, }) => { const [name, setName] = React.useState(currentLabel); const handleRename = () => { onRename(name); onClose(); }; return (
setName(value)} isRequired />
); }; export const createSavedViewRenameModal = createModalLauncher(SavedViewRenameModal, { 'data-test': 'saved-view-rename-modal', title: 'Rename saved view', variant: ModalVariant.small, });