import Button from '@components/Button/Button'; import { Select } from '@components/Select/Select'; import { Dialog, DialogActions, DialogContent, DialogTitle, TextField } from '@mui/material'; import React from 'react'; import { Option } from '../Filter'; import './save-filter-popup.scss'; export interface SaveFilterPopupProps { id: string; value: string; open: boolean; onClose: () => void; onSave: (filter: Option) => void; } const SaveFilterPopup = (props: SaveFilterPopupProps) => { const { onClose, value: valueProp, open, onSave, ...other } = props; const [name, setName] = React.useState(''); const [scope, setScope] = React.useState(''); const handleCancel = () => { onClose(); }; const handleOk = () => { const newFilter = { label: name, value: name, scope: scope } onSave(newFilter); onClose(); }; const handleScopeChange = (newValue: string) => { setScope(newValue); }; const handleNameChange = (newValue: string) => { setName(newValue) }; return (
New Filter
This will save the current values into a new filter.
Name *
handleNameChange(e.target.value) }>
Scope *
) } export default SaveFilterPopup