Skip to content

Commit

Permalink
chore(ui): lint
Browse files Browse the repository at this point in the history
  • Loading branch information
psychedelicious committed Dec 28, 2023
1 parent 2d4a019 commit 5ebaea2
Show file tree
Hide file tree
Showing 2 changed files with 45 additions and 57 deletions.
Original file line number Diff line number Diff line change
@@ -1,22 +1,14 @@
import { Flex, Spacer } from '@chakra-ui/react';
import { useAppDispatch } from 'app/store/storeHooks';
import { InvButton } from 'common/components/InvButton/InvButton';
import { InvButtonGroup } from 'common/components/InvButtonGroup/InvButtonGroup';
import ClearQueueButton from 'features/queue/components/ClearQueueButton';
import QueueFrontButton from 'features/queue/components/QueueFrontButton';
import ProgressBar from 'features/system/components/ProgressBar';
import { useFeatureStatus } from 'features/system/hooks/useFeatureStatus';
import { setActiveTab } from 'features/ui/store/uiSlice';
import { useCallback } from 'react';
import { useTranslation } from 'react-i18next';
import { useGetQueueStatusQuery } from 'services/api/endpoints/queue';

import { InvokeQueueBackButton } from './InvokeQueueBackButton';
import { QueueActionsMenuButton } from './QueueActionsMenuButton';

const QueueControls = () => {
const isPauseEnabled = useFeatureStatus('pauseQueue').isFeatureEnabled;
const isResumeEnabled = useFeatureStatus('resumeQueue').isFeatureEnabled;
const isPrependEnabled = useFeatureStatus('prependQueue').isFeatureEnabled;
return (
<Flex
Expand Down Expand Up @@ -47,52 +39,52 @@ const QueueControls = () => {

export default QueueControls;

const QueueCounts = () => {
const { t } = useTranslation();
const dispatch = useAppDispatch();
const { hasItems, pending } = useGetQueueStatusQuery(undefined, {
selectFromResult: ({ data }) => {
if (!data) {
return {
hasItems: false,
pending: 0,
};
}
// const QueueCounts = () => {
// const { t } = useTranslation();
// const dispatch = useAppDispatch();
// const { hasItems, pending } = useGetQueueStatusQuery(undefined, {
// selectFromResult: ({ data }) => {
// if (!data) {
// return {
// hasItems: false,
// pending: 0,
// };
// }

const { pending, in_progress } = data.queue;
// const { pending, in_progress } = data.queue;

return {
hasItems: pending + in_progress > 0,
pending,
};
},
});
// return {
// hasItems: pending + in_progress > 0,
// pending,
// };
// },
// });

const handleClick = useCallback(() => {
dispatch(setActiveTab('queue'));
}, [dispatch]);
// const handleClick = useCallback(() => {
// dispatch(setActiveTab('queue'));
// }, [dispatch]);

return (
<Flex
justifyContent="space-between"
alignItems="center"
pe={1}
data-testid="queue-count"
>
<Spacer />
<InvButton
onClick={handleClick}
size="sm"
variant="link"
opacity={0.7}
fontStyle="oblique 10deg"
>
{hasItems
? t('queue.queuedCount', {
pending,
})
: t('queue.queueEmpty')}
</InvButton>
</Flex>
);
};
// return (
// <Flex
// justifyContent="space-between"
// alignItems="center"
// pe={1}
// data-testid="queue-count"
// >
// <Spacer />
// <InvButton
// onClick={handleClick}
// size="sm"
// variant="link"
// opacity={0.7}
// fontStyle="oblique 10deg"
// >
// {hasItems
// ? t('queue.queuedCount', {
// pending,
// })
// : t('queue.queueEmpty')}
// </InvButton>
// </Flex>
// );
// };
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,7 @@ const InvokeTabs = () => {
);

const {
minSize: sidePanelMinSize,
isCollapsed: isSidePanelCollapsed,
setIsCollapsed: setIsSidePanelCollapsed,
ref: sidePanelRef,
reset: resetSidePanel,
expand: expandSidePanel,
collapse: collapseSidePanel,
toggle: toggleSidePanel,
Expand Down

0 comments on commit 5ebaea2

Please sign in to comment.