import React from "react"
import { classNames } from "../../../utils"
import { CenterAligned } from "../../CenterAligned"
import { EmptyState, EmptyStateProps } from "../../EmptyState"
import {
  ScatterplotSkeleton,
  ScatterplotSkeletonProps,
} from "./ScatterplotSkeleton"

type Props = {
  className?: string
  overrides?: {
    Skeleton?: Partial<ScatterplotSkeletonProps>
    EmptyState?: Partial<EmptyStateProps>
  }
}

export function ScatterplotEmptyState({ overrides, className }: Props) {
  return (
    <ScatterplotSkeleton
      {...overrides?.Skeleton}
      className={classNames(className, overrides?.Skeleton?.className)}
      contentClassName={classNames(
        "opacity-25",
        overrides?.Skeleton?.contentClassName,
      )}
      skeletonClassName={classNames(
        "animate-none",
        overrides?.Skeleton?.skeletonClassName,
      )}
    >
      <CenterAligned className="absolute size-full [background:radial-gradient(theme(colors.base-1),transparent,transparent)]">
        <EmptyState
          showIcon={false}
          variant="no-chart-data"
          {...overrides?.EmptyState}
        />
      </CenterAligned>
    </ScatterplotSkeleton>
  )
}
