import { Stack } from '@mui/material';

import { copyLinkContainerStyle } from '../constants';

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

const HeaderInfo = ({ children, copyLinkButton }: HeaderInfoProps) => (
  <Stack
    sx={{
      flexDirection: 'row',
      alignItems: 'center',
      gap: 1,
      flex: 1,
      minWidth: 0,
      ...(copyLinkButton ? copyLinkContainerStyle : {}),
    }}
  >
    {children}
    {copyLinkButton && <Stack id="copy-link-button">{copyLinkButton}</Stack>}
  </Stack>
);

export default HeaderInfo;
