// @flow
import React from 'react';
import Button from 'component/button';
import FilePrice from 'component/filePrice';
import { formatLbryUrlForWeb } from 'util/url';
import { withRouter } from 'react-router';
import { URL } from 'config';
import * as ICONS from 'constants/icons';

type Props = {
  uri: string,
  title: ?string,
  isInApp: boolean,
};

function FileViewerEmbeddedTitle(props: Props) {
  const { uri, title, isInApp } = props;

  let contentLink = `${formatLbryUrlForWeb(uri)}`;

  if (!isInApp) {
    contentLink = `${contentLink}?src=embed`;
  }

  const contentLinkProps = isInApp ? { navigate: contentLink } : { href: contentLink };
  const lbryLinkProps = isInApp ? { navigate: '/' } : { href: URL };

  return (
    <div className="file-viewer__embedded-header">
      <div className="file-viewer__embedded-gradient" />
      <Button label={title} button="link" className="file-viewer__embedded-title" {...contentLinkProps} />
      <div className="file-viewer__embedded-info">
        <Button className="file-viewer__overlay-logo" icon={ICONS.LBRY} {...lbryLinkProps} />
        {isInApp && <FilePrice uri={uri} />}
      </div>
    </div>
  );
}

export default withRouter(FileViewerEmbeddedTitle);

// @flow
import React from 'react';
import Button from 'component/button';
import FilePrice from 'component/filePrice';
import { formatLbryUrlForWeb } from 'util/url';
import { withRouter } from 'react-router';
import { URL } from 'config';
import * as ICONS from 'constants/icons';

type Props = {
  uri: string,
  title: ?string,
  isInApp: boolean,
};

function FileViewerEmbeddedTitle(props: Props) {
  const { uri, title, isInApp } = props;

  let contentLink = `${formatLbryUrlForWeb(uri)}`;

  if (!isInApp) {
    contentLink = `${contentLink}?src=embed`;
  }

  const contentLinkProps = isInApp ? { navigate: contentLink } : { href: contentLink };
  const lbryLinkProps = isInApp ? { navigate: '/' } : { href: URL };

  return (
    <div className="file-viewer__embedded-header">
      <div className="file-viewer__embedded-gradient" />
      <Button
        label={title}
        aria-label={title}
        button="link"
        className="file-viewer__embedded-title"
        {...contentLinkProps}
      />
      <div className="file-viewer__embedded-info">
        <Button className="file-viewer__overlay-logo" icon={ICONS.LBRY} aria-label={__('Home')} {...lbryLinkProps} />
        {isInApp && <FilePrice uri={uri} />}
      </div>
    </div>
  );
}

export default withRouter(FileViewerEmbeddedTitle);

Add tooltip to embed's Title and Home button
Add tooltip to embed's Title and Home button

## Issue
- Most titles don't fit the embed container width. I wish to know what the title is without having to click on it first.
- Also, add clarity that the LBRY icon brings you Home.
