import { Box, TextField } from "@mui/material";
import { Button } from "react-bootstrap";
import styled from "styled-components";

export const Post = styled(Box)`
  align-items: center;
  width: 80%;
  height: auto;
  margin: 0 auto;
  margin-top: 40px;
  background: #fff;
  border: 1px solid #dfdfdf;
`;

export const Info = styled(Box)`
  width: 100%;
  height: 60px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 20px;
`;

export const User = styled(Box)`
  display: flex;
  align-items: center;
`;

export const Avatar = styled((props) => (
  <Box component="img" alt="profile-avatar" src={props.src} {...props} />
))`
  height: 40px;
  width: 40px;
  padding: 0;
  background: none;
  border-radius: 50%;
`;

export const Icon = styled((props) => (
  <Box component="img" alt="icon" src={props.src} {...props} />
))`
  height: 10px;
  cursor: pointer;
`;

export const PostImage = styled((props) => (
  <Box component="img" alt="post" src={props.src} {...props} />
))`
  width: 100%;
  height: 500px;
  object-fit: cover;
`;

export const PostContent = styled(Box)`
  width: 100%;
  padding: 20px;
`;

export const ReactionWrapper = styled(Box)`
  width: 100%;
  height: 50px;
  display: flex;
  margin-top: -20px;
  align-items: center;
`;

export const Description = styled(Box)`
  display: flex;
  flex-direction: row;
  margin: 10px 0;
  font-size: 16px;
  line-height: 20px;
`;

export const ReactionIcon = styled((props) => (
  <Box
    component="img"
    alt={props.alt}
    src={props.src}
    onClick={props.onClick}
    {...props}
  />
))`
  cursor: pointer;
  height: 25px;
  margin: 0;
  margin-right: 5px;
`;

export const PostTime = styled(Box)`
  color: rgba(0, 0, 0, 0.5);
  font-size: 12px;
`;

export const CommentWrapper = styled(Box)`
  padding: 5px 20px;
  width: 100%;
  height: 50px;
  border-radius: 1px solid #dfdfdf;
  display: flex;
  justify-content: space-between;
  align-items: center;
`;

export const IconComment = styled((props) => (
  <Box component="img" alt="smile-icon" src={props.src} {...props} />
))`
  height: 22px;
`;

export const CommentBox = styled((props) => (
  <TextField {...props} placeholder="add a comment" variant="filled" />
))`
  & .MuiInputBase-root {
    background-color: transparent !important;
  }
  &.MuiFormControl-root {
    width: 80% !important;
    height: 100% !important;
    padding-top: 5px !important;
    padding-left: 5px;
    & .MuiInputBase-input {
      padding: 5px !important;
      font-size: 14px !important;
      background-color: transparent !important;
    }
  }
`;

export const StyledButton = styled(Button)`
  width: 70px;
  height: 100%;
  background: none;
  border: none;
  outline: none;
  text-transform: capitalize;
  font-size: 16px;
  color: rgb(0, 162, 255);
  opacity: 0.5;
`;
