refactor(web): remove typescript
This commit is contained in:
@@ -1,5 +1,4 @@
|
||||
import React from 'react';
|
||||
import type { IField } from 'types';
|
||||
import LoadingButton from '@mui/lab/LoadingButton';
|
||||
import Alert from '@mui/material/Alert';
|
||||
import Dialog from '@mui/material/Dialog';
|
||||
@@ -7,32 +6,12 @@ import DialogContent from '@mui/material/DialogContent';
|
||||
import DialogContentText from '@mui/material/DialogContentText';
|
||||
import DialogTitle from '@mui/material/DialogTitle';
|
||||
import CircularProgress from '@mui/material/CircularProgress';
|
||||
import { FieldValues, SubmitHandler } from 'react-hook-form';
|
||||
import type { UseFormProps } from 'react-hook-form';
|
||||
import type { ApolloError } from '@apollo/client';
|
||||
|
||||
import useFormatMessage from 'hooks/useFormatMessage';
|
||||
import InputCreator from 'components/InputCreator';
|
||||
import Switch from 'components/Switch';
|
||||
import TextField from 'components/TextField';
|
||||
|
||||
import { Form } from './style';
|
||||
|
||||
type AdminApplicationAuthClientDialogProps = {
|
||||
title: string;
|
||||
authFields?: IField[];
|
||||
defaultValues: UseFormProps['defaultValues'];
|
||||
loading: boolean;
|
||||
submitting: boolean;
|
||||
disabled?: boolean;
|
||||
error?: ApolloError;
|
||||
submitHandler: SubmitHandler<FieldValues>;
|
||||
onClose: () => void;
|
||||
};
|
||||
|
||||
export default function AdminApplicationAuthClientDialog(
|
||||
props: AdminApplicationAuthClientDialogProps
|
||||
): React.ReactElement {
|
||||
export default function AdminApplicationAuthClientDialog(props) {
|
||||
const {
|
||||
error,
|
||||
onClose,
|
||||
@@ -45,7 +24,6 @@ export default function AdminApplicationAuthClientDialog(
|
||||
disabled = false,
|
||||
} = props;
|
||||
const formatMessage = useFormatMessage();
|
||||
|
||||
return (
|
||||
<Dialog open={true} onClose={onClose}>
|
||||
<DialogTitle>{title}</DialogTitle>
|
||||
@@ -80,7 +58,7 @@ export default function AdminApplicationAuthClientDialog(
|
||||
label={formatMessage('authClient.inputName')}
|
||||
fullWidth
|
||||
/>
|
||||
{authFields?.map((field: IField) => (
|
||||
{authFields?.map((field) => (
|
||||
<InputCreator key={field.key} schema={field} />
|
||||
))}
|
||||
<LoadingButton
|
@@ -1,6 +1,5 @@
|
||||
import { styled } from '@mui/material/styles';
|
||||
import BaseForm from 'components/Form';
|
||||
|
||||
export const Form = styled(BaseForm)(({ theme }) => ({
|
||||
display: 'flex',
|
||||
flexDirection: 'column',
|
Reference in New Issue
Block a user