import { css } from "@emotion/react";
import { globalColor } from "@/utils/colorBuilder";
import { Theme } from "@mui/material";

export const componentContainerStyle = css`
  border-top: 1px solid ${globalColor(`grayBlue-08`)};
  width: 100%;
  height: 100%;
  padding-bottom: 40px;
  overflow-y: hidden;
  display: flex;
  flex-direction: column;
`;
export const searchWrapperStyle = css`
  padding: 16px 16px 8px 16px;
`;

export const sessionListContainerStyle = css`
  ${searchWrapperStyle};
  padding-top: 0;
  padding-bottom: 0;
  height: 100%;
  overflow-y: auto;
  width: 100%;
  display: flex;
  flex-direction: column;
`;

export const sessionContainerStyle = css`
  width: 100%;
  display: inline-flex;
  flex-direction: column;

  &:not(:nth-of-type(1)) {
    margin-top: 8px;
  }
`;

export const sessionTitleStyle = (theme: Theme) => css`
  height: 38px;
  width: 100%;
  font-size: 14px;
  color: ${theme.palette.text.primary};
  font-weight: 500;
  display: inline-flex;
  align-items: center;
`;

export const componentListContainerStyle = css`
  width: 100%;
  display: grid;
  grid-template-columns: repeat(3, 88px);
  gap: 16px 8px;
`;

export const itemContainerStyle = css`
  display: flex;
  flex: 1 1 auto;
  flex-direction: column;
  align-items: center;
  position: relative;
  width: 88px;
`;

export const iconStyle = (theme: Theme) => css`
  display: flex;
  justify-content: center;
  align-items: center;
  background-color: ${theme.palette.action.focus};
  cursor: grab;
  border-radius: 4px;
  color:${theme.palette.text.secondary}
  transition: background-color 200ms ease-in-out;
  padding: 8px;

  &:hover {
    background-color: ${theme.palette.action.selected};
  }
`;
export const addComponentContainerStyle = (theme: Theme,isHover:boolean) => css`
  font-size: 12px;
  color: ${theme.palette.text.secondary};
  text-overflow: ellipsis;
  cursor: pointer;
  height: 12px;
  width: 45px ;
  padding: 0px 4px 0 2px;
  border-radius:2px;
  background: ${isHover?theme.palette.action.focus:"none"};
  overflow: hidden;
  
  text-align: center;
  line-height: 10px;
`;
export const addComponentStyle = (theme: Theme) => css`

`;
export const nameStyle = (theme: Theme) => css`
  font-size: 12px;
  width: 100%;
  color: ${theme.palette.text.secondary};
  text-overflow: ellipsis;
  box-sizing: border-box;
  padding: 4px 4px 0 4px;
  overflow: hidden;
  text-align: center;
  line-height: 14px;
`;

export const emptyContainerStyle = css`
  width: 100%;
  height: 319px;
  display: flex;
  align-items: center;
  justify-content: center;
`;
