Skip to content

Commit

Permalink
refactor clean type
Browse files Browse the repository at this point in the history
  • Loading branch information
FredrikOseberg committed Oct 24, 2023
1 parent ceb56b5 commit 8779757
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { ConditionallyRender } from 'component/common/ConditionallyRender/Condit
import TimeAgo from 'react-timeago';
import { LastSeenTooltip } from 'component/common/Table/cells/FeatureSeenCell/LastSeenTooltip';
import { FC, ReactElement } from 'react';
import { IEnvironments } from 'interfaces/featureToggle';
import { IEnvironments, IFeatureEnvironment } from 'interfaces/featureToggle';
import { TooltipResolver } from 'component/common/TooltipResolver/TooltipResolver';
import { Box, styled, SxProps } from '@mui/material';
import { ReactComponent as UsageLine } from 'assets/icons/usage-line.svg';
Expand All @@ -12,7 +12,7 @@ import { getLatestLastSeenAt } from './getLatestLastSeenAt';

interface IFeatureEnvironmentSeenProps {
featureLastSeen: string | undefined;
environments: IEnvironments[];
environments: IEnvironments[] | IFeatureEnvironment[];
sx?: SxProps;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { IEnvironments } from 'interfaces/featureToggle';
import { IEnvironments, IFeatureEnvironment } from 'interfaces/featureToggle';

export const getLatestLastSeenAt = (
environments: IEnvironments[],
environments: IEnvironments[] | IFeatureEnvironment[],
): string | null => {
try {
if (!Array.isArray(environments) || environments.length === 0) {
Expand Down
8 changes: 0 additions & 8 deletions frontend/src/timeago.d.ts
Original file line number Diff line number Diff line change
@@ -1,15 +1,7 @@
declare module 'react-timeago' {
import React from 'react';

// Specify the props if necessary. This is just a placeholder.
interface TimeAgoProps {
date: Date | string | number;
}

// This declaration asserts that the default export from the module is a
// React component with the specified props.
const TimeAgo: React.FC<ReactTimeagoProps>;

// Enable the use of the import syntax
export default TimeAgo;
}

0 comments on commit 8779757

Please sign in to comment.