chore: helper function added and code refactor (#6419)

This commit is contained in:
Anmol Singh Bhatia 2025-01-17 15:41:34 +05:30 committed by GitHub
parent 00cc338c07
commit 9ae1ce0a9a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 17 additions and 0 deletions

View file

@ -0,0 +1,12 @@
"use client";
import React, { FC } from "react";
type Props = {
issueId: string;
};
export const IssueStats: FC<Props> = (props) => {
const { issueId } = props;
return <></>;
};

View file

@ -22,6 +22,7 @@ import { TSelectionHelper } from "@/hooks/use-multiple-select";
import { usePlatformOS } from "@/hooks/use-platform-os";
// plane web components
import { IssueIdentifier } from "@/plane-web/components/issues";
import { IssueStats } from "@/plane-web/components/issues/issue-layouts/issue-stats";
// types
import { TRenderQuickActions } from "./list-view-types";
@ -276,6 +277,7 @@ export const IssueBlock = observer((props: IssueBlockProps) => {
<div className="flex flex-shrink-0 items-center gap-2">
{!issue?.tempId ? (
<>
{isEpic && <IssueStats issueId={issue.id} />}
<IssueProperties
className={`relative flex flex-wrap ${isSidebarCollapsed ? "md:flex-grow md:flex-shrink-0" : "lg:flex-grow lg:flex-shrink-0"} items-center gap-2 whitespace-nowrap`}
issue={issue}

View file

@ -39,3 +39,6 @@ export const debounce = (func: any, wait: number, immediate: boolean = false) =>
export const cn = (...inputs: ClassValue[]) => twMerge(clsx(inputs));
export const convertRemToPixel = (rem: number): number => rem * 0.9 * 16;
export const getProgress = (completed: number | undefined, total: number | undefined) =>
total && total > 0 ? Math.round(((completed ?? 0) / total) * 100) : 0;