Files
plane/apps/web/core/components/estimates/empty-screen.tsx
chuan bba4bb40c8
Some checks failed
CodeQL / Analyze (javascript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
feat: init
2025-11-11 01:56:44 +08:00

49 lines
1.4 KiB
TypeScript

"use client";
import type { FC } from "react";
import { useTheme } from "next-themes";
import { PROJECT_SETTINGS_TRACKER_ELEMENTS, PROJECT_SETTINGS_TRACKER_EVENTS } from "@plane/constants";
// plane imports
import { useTranslation } from "@plane/i18n";
// components
import { DetailedEmptyState } from "@/components/empty-state/detailed-empty-state-root";
// helpers
import { captureElementAndEvent } from "@/helpers/event-tracker.helper";
type TEstimateEmptyScreen = {
onButtonClick: () => void;
};
export const EstimateEmptyScreen: FC<TEstimateEmptyScreen> = (props) => {
// props
const { onButtonClick } = props;
const { resolvedTheme } = useTheme();
const { t } = useTranslation();
const resolvedPath = `/empty-state/project-settings/estimates-${resolvedTheme === "light" ? "light" : "dark"}.png`;
return (
<DetailedEmptyState
title={""}
description={""}
assetPath={resolvedPath}
className="w-full !px-0 !py-0"
primaryButton={{
text: t("project_settings.empty_state.estimates.primary_button"),
onClick: () => {
onButtonClick();
captureElementAndEvent({
element: {
elementName: PROJECT_SETTINGS_TRACKER_ELEMENTS.ESTIMATES_EMPTY_STATE_CREATE_BUTTON,
},
event: {
eventName: PROJECT_SETTINGS_TRACKER_EVENTS.estimate_created,
state: "SUCCESS",
},
});
},
}}
/>
);
};