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;
|
2023-07-18 14:48:34 +03:00
|
|
|
}
|
|
|
|
|
|
2023-07-06 14:22:44 +03:00
|
|
|
export const TableStyled = styled.table`
|
|
|
|
|
width: 100%;
|
|
|
|
|
border-top: 1px solid rgba(253, 253, 253, 0.12);
|
|
|
|
|
border-radius: 2px 2px 0 0;
|
|
|
|
|
border-collapse: separate;
|
|
|
|
|
border-spacing: 0;
|
|
|
|
|
border-inline-start: 1px solid rgba(253, 253, 253, 0.12);
|
|
|
|
|
border-inline-end: 1px solid rgba(253, 253, 253, 0.12);
|
|
|
|
|
`;
|
|
|
|
|
|
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;
|
|
|
|
|
border-inline-end: 1px solid rgba(253, 253, 253, 0.12);
|
|
|
|
|
border-top: 1px solid rgba(253, 253, 253, 0.12);
|
2023-09-10 11:43:17 +05:30
|
|
|
background-color: ${(props): string =>
|
|
|
|
|
props.$isDarkMode ? themeColors.black : themeColors.whiteCream};
|
|
|
|
|
|
|
|
|
|
color: ${(props): string =>
|
|
|
|
|
props.$isDarkMode ? themeColors.white : themeColors.bckgGrey};
|
2023-07-06 14:22:44 +03:00
|
|
|
`;
|
|
|
|
|
|
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
|
|
|
}
|
|
|
|
|
|
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: ${
|
|
|
|
|
!$isDarkMode ? themeColors.lightgrey : themeColors.bckgGrey
|
|
|
|
|
};`}
|
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;
|
|
|
|
|
border-inline-end: 1px solid rgba(253, 253, 253, 0.12);
|
2023-09-10 11:43:17 +05:30
|
|
|
background-color: ${(props): string =>
|
|
|
|
|
!props.$isDarkMode ? themeColors.whiteCream : themeColors.bckgGrey};
|
|
|
|
|
|
|
|
|
|
${({ $isDragColumn }): string => ($isDragColumn ? 'cursor: col-resize;' : '')}
|
|
|
|
|
|
|
|
|
|
color: ${(props): string =>
|
|
|
|
|
props.$isDarkMode ? themeColors.white : themeColors.bckgGrey};
|
2023-07-18 14:48:34 +03:00
|
|
|
|
2023-07-06 14:22:44 +03:00
|
|
|
&:first-child {
|
|
|
|
|
border-start-start-radius: 2px;
|
|
|
|
|
}
|
|
|
|
|
&:last-child {
|
|
|
|
|
border-start-end-radius: 2px;
|
|
|
|
|
border-inline-end: none;
|
|
|
|
|
}
|
|
|
|
|
`;
|