refactor(web): remove typescript
This commit is contained in:
@@ -4,31 +4,21 @@ import Stack from '@mui/material/Stack';
|
||||
import Box from '@mui/material/Box';
|
||||
import Tooltip from '@mui/material/Tooltip';
|
||||
import Typography from '@mui/material/Typography';
|
||||
import type { IExecution } from 'types';
|
||||
|
||||
import useFormatMessage from 'hooks/useFormatMessage';
|
||||
|
||||
type ExecutionHeaderProps = {
|
||||
execution: IExecution;
|
||||
};
|
||||
|
||||
function ExecutionName(props: Pick<IExecution['flow'], 'name'>) {
|
||||
function ExecutionName(props) {
|
||||
return (
|
||||
<Typography variant="h3" gutterBottom>
|
||||
{props.name}
|
||||
</Typography>
|
||||
);
|
||||
}
|
||||
|
||||
function ExecutionId(props: Pick<IExecution, 'id'>) {
|
||||
function ExecutionId(props) {
|
||||
const formatMessage = useFormatMessage();
|
||||
|
||||
const id = (
|
||||
<Typography variant="body1" component="span">
|
||||
{props.id}
|
||||
</Typography>
|
||||
);
|
||||
|
||||
return (
|
||||
<Box sx={{ display: 'flex' }}>
|
||||
<Typography variant="body2">
|
||||
@@ -37,13 +27,9 @@ function ExecutionId(props: Pick<IExecution, 'id'>) {
|
||||
</Box>
|
||||
);
|
||||
}
|
||||
|
||||
function ExecutionDate(props: Pick<IExecution, 'createdAt'>) {
|
||||
const createdAt = DateTime.fromMillis(
|
||||
parseInt(props.createdAt as string, 10)
|
||||
);
|
||||
function ExecutionDate(props) {
|
||||
const createdAt = DateTime.fromMillis(parseInt(props.createdAt, 10));
|
||||
const relativeCreatedAt = createdAt.toRelative();
|
||||
|
||||
return (
|
||||
<Tooltip
|
||||
title={createdAt.toLocaleString(DateTime.DATETIME_FULL_WITH_SECONDS)}
|
||||
@@ -54,14 +40,9 @@ function ExecutionDate(props: Pick<IExecution, 'createdAt'>) {
|
||||
</Tooltip>
|
||||
);
|
||||
}
|
||||
|
||||
export default function ExecutionHeader(
|
||||
props: ExecutionHeaderProps
|
||||
): React.ReactElement {
|
||||
export default function ExecutionHeader(props) {
|
||||
const { execution } = props;
|
||||
|
||||
if (!execution) return <React.Fragment />;
|
||||
|
||||
return (
|
||||
<Stack direction="column">
|
||||
<Stack
|
Reference in New Issue
Block a user