2023-07-06 14:22:44 +03:00
|
|
|
import { themeColors } from 'constants/theme';
|
|
|
|
|
import styled from 'styled-components';
|
2023-07-31 10:57:07 +03:00
|
|
|
import { getActiveLogBackground } from 'utils/logs';
|
2023-07-06 14:22:44 +03:00
|
|
|
|
2023-07-18 14:48:34 +03:00
|
|
|
interface TableHeaderCellStyledProps {
|
2023-09-10 11:43:17 +05:30
|
|
|
$isDragColumn: boolean;
|
|
|
|
|
$isDarkMode: boolean;
|
2024-02-12 00:23:19 +05:30
|
|
|
$isTimestamp?: boolean;
|
2023-07-18 14:48:34 +03:00
|
|
|
}
|
|
|
|
|
|
2023-07-06 14:22:44 +03:00
|
|
|
export const TableStyled = styled.table`
|
|
|
|
|
width: 100%;
|
|
|
|
|
`;
|
|
|
|
|
|
2023-09-10 11:43:17 +05:30
|
|
|
export const TableCellStyled = styled.td<TableHeaderCellStyledProps>`
|
2023-07-06 14:22:44 +03:00
|
|
|
padding: 0.5rem;
|
2023-09-10 11:43:17 +05:30
|
|
|
background-color: ${(props): string =>
|
2024-02-12 00:23:19 +05:30
|
|
|
props.$isDarkMode ? 'inherit' : themeColors.whiteCream};
|
2023-09-10 11:43:17 +05:30
|
|
|
|
|
|
|
|
color: ${(props): string =>
|
|
|
|
|
props.$isDarkMode ? themeColors.white : themeColors.bckgGrey};
|
2023-07-06 14:22:44 +03:00
|
|
|
`;
|
|
|
|
|
|
2024-02-12 00:23:19 +05:30
|
|
|
// handle the light theme here
|
2023-07-30 14:02:18 +03:00
|
|
|
export const TableRowStyled = styled.tr<{
|
|
|
|
|
$isActiveLog: boolean;
|
2023-09-10 11:43:17 +05:30
|
|
|
$isDarkMode: boolean;
|
2023-07-30 14:02:18 +03:00
|
|
|
}>`
|
|
|
|
|
td {
|
2023-07-31 10:57:07 +03:00
|
|
|
${({ $isActiveLog }): string => getActiveLogBackground($isActiveLog)}
|
2023-07-30 14:02:18 +03:00
|
|
|
}
|
|
|
|
|
|
2024-02-12 00:23:19 +05:30
|
|
|
cursor: pointer;
|
|
|
|
|
position: relative;
|
|
|
|
|
|
|
|
|
|
.log-line-action-buttons {
|
|
|
|
|
display: none;
|
|
|
|
|
}
|
|
|
|
|
|
2023-07-06 14:22:44 +03:00
|
|
|
&:hover {
|
|
|
|
|
${TableCellStyled} {
|
2023-09-10 11:43:17 +05:30
|
|
|
${({ $isActiveLog, $isDarkMode }): string =>
|
2023-07-31 10:57:07 +03:00
|
|
|
$isActiveLog
|
|
|
|
|
? getActiveLogBackground()
|
2023-09-10 11:43:17 +05:30
|
|
|
: `background-color: ${
|
2024-02-12 00:23:19 +05:30
|
|
|
!$isDarkMode ? 'var(--bg-vanilla-200)' : 'rgba(171, 189, 255, 0.04)'
|
|
|
|
|
}`}
|
|
|
|
|
}
|
|
|
|
|
.log-line-action-buttons {
|
|
|
|
|
display: flex;
|
2023-07-06 14:22:44 +03:00
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
`;
|
|
|
|
|
|
2023-07-18 14:48:34 +03:00
|
|
|
export const TableHeaderCellStyled = styled.th<TableHeaderCellStyledProps>`
|
2023-07-06 14:22:44 +03:00
|
|
|
padding: 0.5rem;
|
2024-02-12 00:23:19 +05:30
|
|
|
font-size: 14px;
|
|
|
|
|
font-style: normal;
|
|
|
|
|
font-weight: 400;
|
|
|
|
|
line-height: 18px;
|
|
|
|
|
letter-spacing: -0.07px;
|
|
|
|
|
background: ${(props): string => (props.$isDarkMode ? '#0b0c0d' : '#fdfdfd')};
|
|
|
|
|
${({ $isTimestamp }): string => ($isTimestamp ? 'padding-left: 24px;' : '')}
|
2023-09-10 11:43:17 +05:30
|
|
|
${({ $isDragColumn }): string => ($isDragColumn ? 'cursor: col-resize;' : '')}
|
|
|
|
|
|
|
|
|
|
color: ${(props): string =>
|
2024-02-12 00:23:19 +05:30
|
|
|
props.$isDarkMode ? 'var(--bg-vanilla-100, #fff)' : themeColors.bckgGrey};
|
2023-07-06 14:22:44 +03:00
|
|
|
`;
|