"use client"; import React from "react"; import { observer } from "mobx-react"; import Image from "next/image"; // ui import { Button } from "@plane/propel/button"; // utils import { cn } from "@plane/utils"; type EmptyStateSize = "sm" | "md" | "lg"; type ButtonConfig = { text: string; prependIcon?: React.ReactNode; appendIcon?: React.ReactNode; onClick?: () => void; disabled?: boolean; }; type Props = { title: string; description?: string; assetPath?: string; size?: EmptyStateSize; primaryButton?: ButtonConfig; secondaryButton?: ButtonConfig; customPrimaryButton?: React.ReactNode; customSecondaryButton?: React.ReactNode; className?: string; }; const sizeClasses = { sm: "md:min-w-[24rem] max-w-[45rem]", md: "md:min-w-[28rem] max-w-[50rem]", lg: "md:min-w-[30rem] max-w-[60rem]", } as const; const CustomButton = ({ config, variant, size, }: { config: ButtonConfig; variant: "primary" | "neutral-primary"; size: EmptyStateSize; }) => ( ); export const DetailedEmptyState: React.FC = observer((props) => { const { title, description, size = "lg", primaryButton, secondaryButton, customPrimaryButton, customSecondaryButton, assetPath, className, } = props; const hasButtons = primaryButton || secondaryButton || customPrimaryButton || customSecondaryButton; return (

{title}

{description &&

{description}

}
{assetPath && ( {title} )} {hasButtons && (
{/* primary button */} {customPrimaryButton ?? (primaryButton?.text && )} {/* secondary button */} {customSecondaryButton ?? (secondaryButton?.text && ( ))}
)}
); });