Some checks failed
Branch Build CE / Build Setup (push) Has been cancelled
Branch Build CE / Build-Push Admin Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Web Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Space Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Live Collaboration Docker Image (push) Has been cancelled
Branch Build CE / Build-Push API Server Docker Image (push) Has been cancelled
Branch Build CE / Build-Push Proxy Docker Image (push) Has been cancelled
Branch Build CE / Build-Push AIO Docker Image (push) Has been cancelled
Branch Build CE / Upload Build Assets (push) Has been cancelled
Branch Build CE / Build Release (push) Has been cancelled
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Codespell / Check for spelling errors (push) Has been cancelled
Sync Repositories / sync_changes (push) Has been cancelled
Synced from upstream: 8853637e981ed7d8a6cff32bd98e7afe20f54362
50 lines
1.7 KiB
TypeScript
50 lines
1.7 KiB
TypeScript
import type { FC } from "react";
|
|
import { observer } from "mobx-react";
|
|
import { Pen, Trash } from "lucide-react";
|
|
import { PROJECT_SETTINGS_TRACKER_ELEMENTS } from "@plane/constants";
|
|
import { Tooltip } from "@plane/propel/tooltip";
|
|
// components
|
|
import { ProIcon } from "@/components/common/pro-icon";
|
|
|
|
type TEstimateListItem = {
|
|
estimateId: string;
|
|
isAdmin: boolean;
|
|
isEstimateEnabled: boolean;
|
|
isEditable: boolean;
|
|
onEditClick?: (estimateId: string) => void;
|
|
onDeleteClick?: (estimateId: string) => void;
|
|
};
|
|
|
|
export const EstimateListItemButtons: FC<TEstimateListItem> = observer((props) => {
|
|
const { estimateId, isAdmin, isEditable, onDeleteClick } = props;
|
|
|
|
if (!isAdmin || !isEditable) return <></>;
|
|
return (
|
|
<div className="relative flex items-center gap-1">
|
|
<Tooltip
|
|
tooltipContent={
|
|
<div className="relative flex items-center gap-2">
|
|
<div>Upgrade</div>
|
|
<ProIcon className="w-3 h-3" />
|
|
</div>
|
|
}
|
|
position="top"
|
|
>
|
|
<button
|
|
className="relative flex-shrink-0 w-6 h-6 flex justify-center items-center rounded cursor-pointer transition-colors overflow-hidden hover:bg-custom-background-80"
|
|
data-ph-element={PROJECT_SETTINGS_TRACKER_ELEMENTS.ESTIMATES_LIST_ITEM}
|
|
>
|
|
<Pen size={12} />
|
|
</button>
|
|
</Tooltip>
|
|
<button
|
|
className="relative flex-shrink-0 w-6 h-6 flex justify-center items-center rounded cursor-pointer transition-colors overflow-hidden hover:bg-custom-background-80"
|
|
onClick={() => onDeleteClick && onDeleteClick(estimateId)}
|
|
data-ph-element={PROJECT_SETTINGS_TRACKER_ELEMENTS.ESTIMATES_LIST_ITEM}
|
|
>
|
|
<Trash size={12} />
|
|
</button>
|
|
</div>
|
|
);
|
|
});
|