import Skeleton from '@design-system/Skeleton';
import Title from '@design-system/Title';

import { type HeaderTitleProps } from './types';

const HeaderTitle = ({ title, loading, slotProps }: HeaderTitleProps) => {
  if (loading)
    return (
      <Skeleton
        width={150}
        height={40}
      />
    );

  return (
    <Title
      variant="L"
      title={title}
      {...slotProps}
    />
  );
};

export default HeaderTitle;
