"use client";

import { FC } from "react";
/* eslint-disable no-underscore-dangle */
import { RawDataViewer } from "@/app/_components/RawDataViewer";
import { VisualizationDetail } from "@/app/_components/VisualizationDetail";

interface PreviewProps {
  visualization: any;
  visualizationType: string;
  data: any[];
}

export const Preview: FC<PreviewProps> = ({
  visualization,
  visualizationType,
  data,
}) =>
  visualizationType === "rawData" ? (
    <RawDataViewer rows={data} height={750} />
  ) : (
    <VisualizationDetail {...visualization} />
  );
