2023-07-31 10:57:07 +03:00
|
|
|
import { blue } from '@ant-design/colors';
|
2023-07-30 14:02:18 +03:00
|
|
|
import { Col, Row, Space } from 'antd';
|
2023-02-15 11:25:15 +02:00
|
|
|
import styled from 'styled-components';
|
2023-07-31 10:57:07 +03:00
|
|
|
import { getActiveLogBackground, getDefaultLogBackground } from 'utils/logs';
|
2023-02-15 11:25:15 +02:00
|
|
|
|
2023-07-30 14:02:18 +03:00
|
|
|
export const RawLogViewContainer = styled(Row)<{
|
|
|
|
|
$isDarkMode: boolean;
|
|
|
|
|
$isReadOnly: boolean;
|
|
|
|
|
$isActiveLog: boolean;
|
|
|
|
|
}>`
|
|
|
|
|
position: relative;
|
2023-02-15 11:25:15 +02:00
|
|
|
width: 100%;
|
|
|
|
|
font-weight: 700;
|
|
|
|
|
font-size: 0.625rem;
|
|
|
|
|
line-height: 1.25rem;
|
|
|
|
|
|
|
|
|
|
transition: background-color 0.2s ease-in;
|
|
|
|
|
|
2023-07-31 10:57:07 +03:00
|
|
|
${({ $isActiveLog }): string => getActiveLogBackground($isActiveLog)}
|
2023-07-30 14:02:18 +03:00
|
|
|
|
2023-07-31 10:57:07 +03:00
|
|
|
${({ $isReadOnly, $isDarkMode, $isActiveLog }): string =>
|
|
|
|
|
$isActiveLog
|
|
|
|
|
? getActiveLogBackground()
|
|
|
|
|
: getDefaultLogBackground($isReadOnly, $isDarkMode)}
|
2023-02-15 11:25:15 +02:00
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
export const ExpandIconWrapper = styled(Col)`
|
|
|
|
|
color: ${blue[6]};
|
|
|
|
|
padding: 0.25rem 0.375rem;
|
|
|
|
|
cursor: pointer;
|
|
|
|
|
font-size: 12px;
|
|
|
|
|
`;
|
2023-02-28 11:03:02 +05:30
|
|
|
|
|
|
|
|
interface RawLogContentProps {
|
|
|
|
|
linesPerRow: number;
|
2023-07-30 14:02:18 +03:00
|
|
|
$isReadOnly: boolean;
|
|
|
|
|
$isActiveLog: boolean;
|
2023-02-28 11:03:02 +05:30
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export const RawLogContent = styled.div<RawLogContentProps>`
|
|
|
|
|
margin-bottom: 0;
|
|
|
|
|
font-family: Fira Code, monospace;
|
|
|
|
|
font-weight: 300;
|
|
|
|
|
|
|
|
|
|
overflow: hidden;
|
|
|
|
|
text-overflow: ellipsis;
|
|
|
|
|
display: -webkit-box;
|
|
|
|
|
-webkit-line-clamp: ${(props): number => props.linesPerRow};
|
|
|
|
|
line-clamp: ${(props): number => props.linesPerRow};
|
|
|
|
|
-webkit-box-orient: vertical;
|
|
|
|
|
|
|
|
|
|
font-size: 1rem;
|
|
|
|
|
line-height: 2rem;
|
|
|
|
|
|
2023-07-30 14:02:18 +03:00
|
|
|
cursor: ${(props): string =>
|
|
|
|
|
props.$isActiveLog || props.$isReadOnly ? 'initial' : 'pointer'};
|
|
|
|
|
|
|
|
|
|
${(props): string =>
|
|
|
|
|
props.$isReadOnly && !props.$isActiveLog ? 'padding: 0 1.5rem;' : ''}
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
export const ActionButtonsWrapper = styled(Space)`
|
|
|
|
|
position: absolute;
|
|
|
|
|
transform: translate(-50%, -50%);
|
|
|
|
|
top: 50%;
|
|
|
|
|
right: 0;
|
2023-02-28 11:03:02 +05:30
|
|
|
cursor: pointer;
|
|
|
|
|
`;
|