import React from "react";
import { ButtonIcon, Typography } from "@komi-app/components";
import "./TemplatePageHeader.scss";

export interface TemplatePageHeaderProps {
  name: string;
  onBackClick: () => void;
}

const TemplatePageHeader = ({ name, onBackClick }: TemplatePageHeaderProps) => {
  return (
    <div className="template-page-header">
      <div className="title">
        <ButtonIcon
          className="template-page-header-arrow"
          icon="arrow/leftLong"
          onClick={onBackClick}
        />
        <Typography.Heading className="title-text" level={3} title={name}>
          {name}
        </Typography.Heading>
      </div>
    </div>
  );
};

export default TemplatePageHeader;
