import * as React from 'react';
import styled from 'styled-components';
import {
  rem,
  zIndex
} from '../../style/function.style';
import {
  imgResize
} from '../../utils/imgResize';
import { formatAvatar, formatNumber } from '../../utils/format';
import { isNumber } from '../../utils/detect';
import {
  PostErrorTip,
  skeletonOneLine,
  skeletonTwoLine,
  skeletonImage,
  mode
} from '../index.style';
import { PostCardConfig, AllDetail } from '../type';
import { formatDescription } from './utils';
import { LofterPostTags } from './Tags';

export const Container = styled.div`
  width: ${rem(339)};
  position: relative;
  font-size: 0;
  &:nth-child(2n+1) {
    margin-right:${rem(26)}
 };
`

export const Header = styled.div`
  position: relative;
  width: 100%;
  height: ${rem(323)};
  border-radius: ${rem(24)};
  margin-top: ${rem(25)};
  margin-right: ${rem(26)};
  .header-img {
    background: #F5F5F5;
    width: 100%;
    height: 100%;
    position: relative;
    z-index: 3;
    border-radius: ${rem(24)};
    border: 1px solid rgba(0, 0, 0, 0.1);
  }
`
export const Image = styled.img`
   width:${rem(339)}
   height:${rem(323)};
   border-radius: ${rem(24)};
`

export const HeaderImageBg = styled.div`
  background-color: #ffffff;
  border: 1px solid #EDEDED;
  border-radius: ${rem(24)};
  position: absolute;
  z-index: 2;
`
// @ts-ignore
export const HeaderImageBg1 = styled(HeaderImageBg)`
  width: ${rem(283)};
  height: ${rem(283)};
  top: ${rem(-14)};
  left: ${rem(12)};
`
// @ts-ignore

export const HeaderImageBg2 = styled(HeaderImageBg)`
  width: ${rem(259)};
  height: ${rem(259)};
  top: ${rem(-26)};
  left: ${rem(24)};
`

export const HeaderImageBorder = styled.div`
  width: 100%;
  height: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 4;
  border-radius: ${rem(24)};
  border: 1px solid rgba(0, 0, 0, 0.1);
`

export const HeaderCommon = styled.span`
  display: -webkit-inline-box;
  padding: ${rem(3)} ${rem(12)};
  background: rgba(0, 0, 0, 0.3);
  border-radius: ${rem(20)};
  position: absolute;
  font-weight: 500;
  color: #FFFFFF;
  font-size: ${rem(24)};
  line-height: ${rem(34)};
  z-index: 4;
  max-width: ${rem(280)};
  text-overflow: ellipsis;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
`
// @ts-ignore
export const HeaderTag = styled(HeaderCommon)`
  left: ${rem(12)};
  top: ${rem(12)};
`

// @ts-ignore
export const HeaderView = styled(HeaderCommon)`
  left: ${rem(16)};
  bottom: ${rem(12)};
`

// @ts-ignore
export const HeaderPost = styled(HeaderCommon)`
  right: ${rem(12)};
  bottom: ${rem(12)};
`

export const InfoContainer = styled.div`
  width: 100%;
  padding: ${rem(16)} ${rem(8)} ${rem(24)};
`


export const Description = styled.div<{ skeleton?: boolean }>`
  margin-top: ${rem(12)};
  margin-bottom: ${rem(6)};
  font-size: ${rem(24)};
  line-height: ${rem(34)};
  color: #b3b3b3;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  ${({ skeleton }) => (
    skeleton ? skeletonOneLine : ''
  )}
`;

export const EmptyDescription = styled.div`
  height: ${rem(40)};
  margin-top: ${rem(8)};
`

export const UserInfo = styled.div`
  display: flex;
  align-items: center;
  .avatar {
    width: ${rem(32)};
    height: ${rem(32)};
    margin-right: ${rem(8)};
    background: #F5F5F5;
    border-radius: 50%;
    flex: 0 0 auto;
  }
  .name {
    font-size: ${rem(22)};
    line-height: ${rem(31)};
    color: #B3B3B3;
    height: ${rem(32)};
    line-height: ${rem(32)};
    word-wrap: break-all;
    // 超出截断
    display: -webkit-box;
    text-overflow: ellipsis;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 1;
    overflow: hidden;
  }
`

export const LoadingCol = styled.div`
  height: ${rem(533)};
  .tips {
    position: absolute;
    color: red;
    top: 0;
    left: 0;
    border: 1px solid red;
    display: inline-block;
    padding: ${rem(2)};
    font-size: ${rem(24)};
  }
  .img {
    display: inline-block;
    width: 100%;
    height: ${rem(307)};
    border-radius: ${rem(24)};
    background: #F5F5F5;
  }
  .title {
    width: 100%;
    height: ${rem(40)};
    margin-top: ${rem(16)};
    background: #F5F5F5;
    border-radius: ${rem(7)};
  }
  .desc {
    background: #F5F5F5;
    width: 100%;
    height: ${rem(40)};
    border-radius: ${rem(20)} ${rem(20)} ${rem(20)} ${rem(4)};
    margin-top: ${rem(8)};
  }
  .user {
    margin-top: ${rem(16)};
    display: flex;
    align-items: center;
    padding-bottom: ${rem(48)};
    .avatar {
      width: ${rem(32)};
      height: ${rem(32)};
      margin-right: ${rem(8)};
      background: #F5F5F5;
      border-radius: 50%;
      flex: 0 0 auto;
    }
    .name {
      width: 100%;
      height: ${rem(31)};
      background: #F5F5F5;
      border-radius: ${rem(7)};
    }
  }
`
export const Author = styled.div`
  line-height: ${rem(40)};
  display: flex;
  align-items: center;
  margin-top: ${rem(16)};
`

export const AuthorAvatar = styled.div<{ skeleton?: boolean, isAuth?: boolean, avatarBoxImage?: string }>`
  width: ${rem(40)};
  height: ${rem(40)};
  border-radius: 100%;
  margin-right: ${rem(16)};
  background-size: 100% auto;
  background-color:${mode === 'light' ? '#ffffff' : '#151515'};
  position: relative;
  border: ${rem(1)} solid rgba(0, 0, 0, 0.1);
  ${({ skeleton }) => (
    skeleton ? skeletonImage : ''
  )}
  ${({ isAuth }) => (
    isAuth ? `
      &::after{
        content: '';
        position: absolute;
        bottom: 0;
        right: 0;
        z-index: 2;
        width: ${rem(16)};
        height: ${rem(16)};
        background: url(${mode === 'light' ? AUTH_ICON : AUTH_ICON_DARK}) no-repeat;
        background-size: 100% auto;
      }
    ` : ''
  )}
`

export const AuthorName = styled.div<{ skeleton?: boolean }>`
  font-size: ${rem(24)};
  line-height: ${rem(30)};
  width: ${rem(283)};
  color: #b3b3b3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align:middle;
  ${({ skeleton }) => (
    skeleton ? `
      width: 30%;
      ${skeletonOneLine}
    ` : ''
  )}
  .nw-dark-mode &{
    color: #888;
  }
`;

export const Title = styled.div<{ skeleton?: boolean, singleLine?: boolean, isCocreate?: boolean }>`
  font-size: ${rem(30)};
  line-height: ${rem(42)};
  font-weight: 500;
  color: #2e2e2e;
  ${({ singleLine }) => (
    singleLine ? `
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    ` : `
      max-height: ${rem(80)};
      overflow: hidden;
      text-overflow: ellipsis;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    `
  )}
  ${({ skeleton, singleLine }) => (
    skeleton ? `
      width: 60%;
      ${singleLine ? skeletonOneLine : skeletonTwoLine}
      ${singleLine ? `height: ${rem(42)}` : `height: ${rem(80)}`}
    ` : ''
  )}
  ${({ isCocreate }) => (
    isCocreate ? `
      width: ${rem(470)};
      position: relative;
      &::after{
        content: '共创';
        position: absolute;
        right: 0;
        top: ${rem(4)};
        width: ${rem(52)};
        line-height: ${rem(28)};
        height: ${rem(28)};
        font-size: ${rem(20)};
        color: #8f8f8f;
        text-align: center;
        border: 1px solid #B3B3B3;
        border-radius: ${rem(8)};
      }
    ` : ''
  )}
  .nw-dark-mode &{
    color: #ccc;
  }
`;
export const Tips = styled.div`
  height: ${rem(40)};
  position: absolute;
  color: red;
  top: ${rem(30)};
  left: ${rem(30)};
  border: 1px solid red;
  display: inline-block;
  padding: ${rem(2)};
  font-size: ${rem(24)};
  z-index: 4;
}`
// 推荐模块icon
export const REC_ICON = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAYbSURBVHgB7ZpdUhtHEIC7Z0WK2E5FN4j8IoeqVAVOEHECm7IhlcoDK/kAwAmAEwAHCIiHlBNwFc4JLJ8APaQKgh/gCEoZpwhop9O9EpTQzv7NzvISfW+a1ezs9PR093QPwIQJEyZM+P+C8ECcv/Fr/1bUC4X4PWlqKIQqAVSHH9EjwAsiuCCkD+pad+o/t7vwAJQqgOM9v/rlE+UrwOcA1MjTl7/sAjRs1pd221AipQ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3Yfoi2IRLR6SAjhTGAIiBszJloIVvc+uIaigqBIqvY9Y0hSJr9sDvERVRApOe4F1n+tq1HrICJXjWSnAal0yRBjHRZN1UqEEcREFpaa65yWiP/AKCDndFJo5rTFIf+fwVVNiAiTv3/AexOSZI5pM39AAAAAElFTkSuQmCC';
// 加v用户icon-深色
export const AUTH_ICON_DARK = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAACMAAAAjCAYAAAAe2bNZAAAACXBIWXMAABYlAAAWJQFJUiTwAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAASaSURBVHgBzVjNbxtFFH92bOPYgjglJh9KxLbUiu0g4QgiFQqSI8gBEFJzoIJT4gOCA1LyHyT5C9IcOdk5c6gRSCC1UouEIIhW3UsdN1GSjZBCRdJ4Q+rYkb94b2pvZ3dn1x/JoT9ptPab8Zvfvo+Z9wzwAsEBHSIcDkv4iDscjrdqtVpAU+hwqPjYRZmczWbvQhtoi4wkSQGfzzeHH+d5ApbKnxFLV6vV1VaItUSmTmIZCcxC51DK5fL05uambLWgC5ogEonMeTyeNBK5AmdDwOl0ftPf3x/w+/1/qqpaNC5wNCGyjI950VzV64XC0AAUcZwODWryrkIBfFsKeP95DO6caqVawZebRNcpLZGJRqNJkVto86O3Y6C+M84I2cG3rUDPvQcQuC+3REhIBjNlAYNvkZfRxvtTk3D4fvveIgu9/l1SZCmlUCiMK4rCJroERGaRyA1eVuoNgPLtV5AfvQydoNrtRWuOg+s4z9zHIeB2u68cHBysmsjQ2YFEkrSIJ7L7dYI9z4Ka2wXHY2Hw5I6MhKRgMHiEhNacvBSjfYEmtTdC15wHER57169BcXDAKF6g40OzTP1ETfEr/v14qmPX2CE/GoLAPRkc5XJD5MXj41SzTN0qGsgaxmBFB4Pk80OrsFpLup98oNeNmTXn5L7E+cn9qbiOxPKbMdj58FMcn7BxbWAILEl0++HOe3G2rvbZ55CMTTAZj9zVd41HQ4CRCYVCMeBipVKP/udkPDB/McRINd745sRViL0ijq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WlDr9Hl3r25Mct992in7oXwpEl3sBAvJ0vy0z3Xa7PSUwAhiIwEknR/YO2j5Xv9VqcblCR3j6Jxbp/xOL/guoYpe/Cv7xjxpKoPnv1elnI9H6w2JgRDP9fcqAjHMRrTs3iU/5xz0ZMANTw84qttzRtCNWUPGjQvcb87jJ8ofF/wEmE7M59n5WwQAAAABJRU5ErkJggg=='


export const CollectionIcon = styled.div`
  display: inline-block;
  width: ${rem(23)};
  height: ${rem(24)};
  background: url(${COLLECTION_ICON}) center center no-repeat;
  background-size: 100% auto;
  margin-right: ${rem(8)};
  .nw-dark-mode &{
    background-image: url(${COLLECTION_ICON_DARK});
  }
`
export const PushIcon = styled.div`
display: inline-block;
width: ${rem(52)};
height: ${rem(32)};
background: url(${PUSH_ICON}) center center no-repeat;
background-size: 100% auto;
margin-right: ${rem(8)};
vertical-align: text-bottom;
// .nw-dark-mode &{
//   background-image: url(${COLLECTION_ICON_DARK});
// }
`





export class LofterSelectedColCard extends React.Component<{
  postCardConfig: PostCardConfig,
  showCover?: boolean,
  post?: false | AllDetail,
  isEdit?: boolean | undefined,
}> {

  render() {
    const {
      post,
      postCardConfig,
      isEdit
    } = this.props;
    const {
      type,
      postId,
      cover,
      title,
      description,
      recommend,
      authorAvatar,
      authorName,
      authorDesc,
      data,
      link,
    } = postCardConfig;
    let isPushFolder, isCollection, isOther, cardName
    if (post) {
      isPushFolder = post?.classifyType === 4;
      isCollection = post?.classifyType === 2;
      isOther = post?.classifyType === 3;
      cardName = isCollection ? '合集' : '文章';
    }
    const skeleton = !post;

    const customCover = cover && cover.url;
    const resizedCover = imgResize(
      customCover || (post && post.firstImage && post.firstImage.orign) || '',
      339,
      323,
      1
    );
    const isAuth = post && post.blogInfo && post.blogInfo.isAuth;
    const resizedAvatar = formatAvatar((authorAvatar && authorAvatar.url) || (post && post.blogInfo?.bigAvaImg));
    // 	https://www.lofter.com/front/blog/collection-push/detail?folderId={收藏夹id}
    return (
      <>
        {post && (isEdit || post.blogInfo || isOther) &&
          <Container
            onClick={() => {
              if (link) {
                window.location.href = link;
              } else if (post) {
                window.location.href = post.postPageUrl;
              }
            }}
          >
            {/* 只有在编辑模式，且不是其他类型（需要接口请求），blogInfo是推集合集文章如果id存在相关信息的共同拥有的属性 */}
            {
              isEdit && post && (!post.blogInfo) && !isOther && <Tips>这个id没有相关信息呢</Tips>
            }
            {
              // 推集存在配置的时候,有信息，后来变成私有了之后没信息的情况
              post && (
                <>
                  <Header
                  >
                    <Image
                      width={323}
                      height={339}
                      src={resizedCover}
                      className='header-img'
                    />
                    <HeaderImageBorder />
                    {
                      post?.subscribedCount
                        ? (
                          <HeaderView>
                            {formatNumber(post?.subscribedCount)}订阅，
                            {formatNumber(post?.postCount)}篇
                          </HeaderView>
                        ) : null
                    }
                  </Header>
                  <InfoContainer>
                    <Title
                      skeleton={(!title) && skeleton}
                      singleLine={isCollection || isOther}
                      isCocreate={post && isCollection && post.collectionType === 1}
                    >
                      {isPushFolder && <PushIcon />}
                      {isCollection && <CollectionIcon />}
                      {/* {title || (post && formatDescription(post.title)) || (post && formatDescription(post.digest))} */}
                      <span dangerouslySetInnerHTML={{
                        __html: title
                          || (post && formatDescription(post.title))
                          || (post && formatDescription(post.digest))
                      }} />
                    </Title>
                    {
                      (isPushFolder || isCollection || isOther) && <Description skeleton={skeleton}>{description || (post && post.digest)}</Description>
                    }
                    {
                      isPushFolder && post.tags && post.tags.length && <LofterPostTags tagList={post.tags}></LofterPostTags>
                    }
                    <UserInfo
                    // onClick={() => {
                    //     //   goToUserPage(colDetail?.blogInfo?.blogName)
                    // }}
                    >
                      <Author>
                        <AuthorAvatar skeleton={skeleton} isAuth={isAuth} style={{ backgroundImage: `url(${resizedAvatar})` }} />
                        <AuthorName
                          skeleton={skeleton}
                        >{authorName || (post && post.blogInfo?.blogNickName)}&nbsp;&nbsp;{authorDesc}</AuthorName>
                      </Author>
                    </UserInfo>
                  </InfoContainer>
                </>
              )
            }
          </Container >
        }
      </>
    )
  }
}
