/** @format */

import styled from 'styled-components';
import CallIcon from '@mui/icons-material/Dialpad';
import { boxDialerWidjetPosition } from '../../lib/boxDialerWidjetPosition';
import {sizePixelPixelSizeFunc} from "../../lib/sizeContext"

const colorTypeFunc = (type) => {
	switch (type) {
		case 'pending':
			return 'orange';
			break;
		case 'connected':
			return '#a0c13d';
			break;

		default:
			break;
	}
};

const BxMiniWidjetUiStyle = styled.div`
	box-shadow: -2px 0px 9px 3px #0000004f;
	font-family: 'Open Sans', 'Helvetica Neue', Helvetica, Arial, sans-serif;
	/* background-color: ${({ status = '' }) =>
		status === 'pending'
			? 'orange'
			: status === 'connected'
			? '#a0c13d'
			: '#ccc'}; */
	/* background-color: ${({ status = '' }) => (status ? status : '#333')}; */
	${({ status }) => (status ? status : {})}
	height: 64px;
	width: 64px;
	border-radius: 13px;
	cursor: pointer;
	color: white;
	z-index: 999;
	position: fixed;
	display: grid;
	align-items: center;
	grid-template-columns: 1fr;
	grid-template-rows: 1fr 10px;

	-webkit-touch-callout: none;
	-webkit-user-select: none;
	-moz-user-select: none;
	-ms-user-select: none;
	user-select: none;

	${({ position }) => boxDialerWidjetPosition.bxmini[position].block}

	.left {
		display: flex;
		flex-direction: column;
		align-items: center;
		margin: 0;
		padding: 0;
		box-sizing: border-box;
	}
	.right {
	}
	.title {
		${({sizePixel})=> sizePixelPixelSizeFunc(sizePixel, 20) }
		font-weight: 600;
		margin: 0;
		padding: 0;
		box-sizing: border-box;
	}
	.bottom {
		height: 100%;
		grid-column: 1/3;
		grid-row: 2/3;
		margin: 0;
		padding: 0;
		box-sizing: border-box;
	}
`;

BxMiniWidjetUiStyle.ReasonTest = styled.div`
	box-sizing: border-box;
	border-radius: 10px;
	padding: 0 1px;
	margin: 0 5px;
	${({sizePixel})=> sizePixelPixelSizeFunc(sizePixel, 12) }

	${({ reason }) =>
		reason == 'free'
			? {
					color: '#ffffffab',
			  }
			: {
					backgroundColor: 'orange',
					color: '#000',
			  }}
`;
BxMiniWidjetUiStyle.StatusLine = styled.div`
	margin: 0;
	box-sizing: border-box;
	height: 100%;
	border-bottom-left-radius: 30px;
	border-bottom-right-radius: 30px;
	/* ${({ status }) => (status ? status : {})} */
	display: flex;
	align-items: center;
	justify-content: flex-end;
	padding: 0;

	.verison {
		font-size: 10px;
		float: right;
		margin: 0 8px 0 0;
		padding: 0;
	}
`;

const DialPadIcon = styled(CallIcon)`
	font-size: 26px;
`;

export { DialPadIcon };
export default BxMiniWidjetUiStyle;
