Skip to content
This repository has been archived by the owner on Jul 2, 2024. It is now read-only.

Commit

Permalink
Adjust types and unnecessary tags
Browse files Browse the repository at this point in the history
  • Loading branch information
khelif96 committed Dec 19, 2023
1 parent 870f6f2 commit bb99e39
Showing 1 changed file with 10 additions and 13 deletions.
23 changes: 10 additions & 13 deletions src/pages/taskQueue/TaskQueueTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,9 @@ import { TaskQueueItem, TaskQueueItemType } from "gql/generated/types";
import { formatZeroIndexForDisplay } from "utils/numbers";
import { msToDuration } from "utils/string";

type TaskQueueColumnData = Omit<TaskQueueItem, "revision">;
interface TaskQueueTableProps {
taskQueue: Omit<TaskQueueItem, "revision">[];
taskQueue: TaskQueueColumnData[];
loading: boolean;
}

Expand All @@ -32,7 +33,7 @@ const TaskQueueTable: React.FC<TaskQueueTableProps> = ({
// eslint-disable-next-line react-hooks/exhaustive-deps
[]
);
const table = useLeafyGreenTable<Omit<TaskQueueItem, "revision">>({
const table = useLeafyGreenTable<TaskQueueColumnData>({
data: taskQueue,
columns,
containerRef: tableContainerRef,
Expand All @@ -54,8 +55,6 @@ const TaskCell = styled.div`
flex-direction: column;
`;

type TaskQueueColumnData = Omit<TaskQueueItem, "revision">;

const taskQueueTableColumns = (
sendEvent: ReturnType<typeof useTaskQueueAnalytics>["sendEvent"]
) => {
Expand All @@ -75,15 +74,13 @@ const taskQueueTableColumns = (
const { buildVariant, displayName, id, project } = value.row.original;
return (
<TaskCell>
<Body>
<StyledRouterLink
data-cy="current-task-link"
to={getTaskRoute(id)}
onClick={() => sendEvent({ name: "Click Task Link" })}
>
<WordBreak>{displayName}</WordBreak>
</StyledRouterLink>
</Body>
<StyledRouterLink
data-cy="current-task-link"
to={getTaskRoute(id)}
onClick={() => sendEvent({ name: "Click Task Link" })}
>
<WordBreak>{displayName}</WordBreak>
</StyledRouterLink>
<Body>{buildVariant}</Body>
<Disclaimer>{project}</Disclaimer>
</TaskCell>
Expand Down

0 comments on commit bb99e39

Please sign in to comment.