import cx from "classnames";
import React, { ReactNode } from "react";

interface PreviewTitleBarProps {
  title?: string;
  actions?: ReactNode[];
  className?: string;
  [key: string]: any;
}

const CLASS_ROOT = "";

const PreviewTitleBar: React.FC<PreviewTitleBarProps> = ({
  className,
  title,
  actions = [],
  ...other
}) => {
  const classes = cx(CLASS_ROOT, className);

  return (
    <div className={cx(classes, "bar justify-content-end")} {...other}>
      {actions.map((action, actionIndex) => (
        <div key={actionIndex}>{action}</div>
      ))}
    </div>
  );
};

PreviewTitleBar.displayName = "PreviewTitleBar";

export default PreviewTitleBar;
