2026-03-03 15:42:03 +00:00
|
|
|
import { styled } from '@linaria/react';
|
2025-11-24 10:23:08 +00:00
|
|
|
import { type ReactNode } from 'react';
|
2026-03-03 15:42:03 +00:00
|
|
|
import { themeCssVariables } from 'twenty-ui/theme-constants';
|
2025-11-24 10:23:08 +00:00
|
|
|
|
|
|
|
|
export const StyledPageInfoContainer = styled.div`
|
|
|
|
|
align-items: center;
|
|
|
|
|
display: flex;
|
2026-03-03 15:42:03 +00:00
|
|
|
gap: ${themeCssVariables.spacing[0.5]};
|
2025-11-24 10:23:08 +00:00
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
export const StyledPageInfoIcon = styled.div<{ iconColor?: string }>`
|
|
|
|
|
align-items: center;
|
2026-03-03 15:42:03 +00:00
|
|
|
background: ${themeCssVariables.background.transparent.light};
|
|
|
|
|
border-radius: ${themeCssVariables.border.radius.sm};
|
|
|
|
|
color: ${({ iconColor }) => iconColor ?? ''};
|
2025-11-24 10:23:08 +00:00
|
|
|
display: flex;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
justify-content: center;
|
2026-03-03 15:42:03 +00:00
|
|
|
padding: ${themeCssVariables.spacing[1]};
|
2025-11-24 10:23:08 +00:00
|
|
|
`;
|
|
|
|
|
|
2025-11-28 10:46:14 +00:00
|
|
|
export const StyledPageInfoTextContainer = styled.div`
|
2025-11-28 17:01:06 +00:00
|
|
|
align-items: center;
|
2025-11-24 10:23:08 +00:00
|
|
|
display: flex;
|
|
|
|
|
flex: 1;
|
2026-03-03 15:42:03 +00:00
|
|
|
gap: ${themeCssVariables.spacing[0.5]};
|
2025-11-28 10:46:14 +00:00
|
|
|
min-width: 0;
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
export const StyledPageInfoTitleContainer = styled.div`
|
2026-03-03 15:42:03 +00:00
|
|
|
font-size: ${themeCssVariables.font.size.md};
|
|
|
|
|
font-weight: ${themeCssVariables.font.weight.semiBold};
|
|
|
|
|
padding-inline: ${themeCssVariables.spacing[1]};
|
2025-11-24 10:23:08 +00:00
|
|
|
min-width: 0;
|
|
|
|
|
max-width: 150px;
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
export const StyledPageInfoLabel = styled.div`
|
2026-03-03 15:42:03 +00:00
|
|
|
color: ${themeCssVariables.font.color.tertiary};
|
|
|
|
|
font-size: ${themeCssVariables.font.size.sm};
|
2025-11-24 10:23:08 +00:00
|
|
|
white-space: nowrap;
|
|
|
|
|
flex-shrink: 0;
|
|
|
|
|
`;
|
|
|
|
|
|
|
|
|
|
type CommandMenuPageInfoLayoutProps = {
|
|
|
|
|
icon?: ReactNode;
|
|
|
|
|
iconColor?: string;
|
|
|
|
|
title: ReactNode;
|
|
|
|
|
label?: ReactNode;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export const CommandMenuPageInfoLayout = ({
|
|
|
|
|
icon,
|
|
|
|
|
iconColor,
|
|
|
|
|
title,
|
|
|
|
|
label,
|
|
|
|
|
}: CommandMenuPageInfoLayoutProps) => {
|
|
|
|
|
return (
|
|
|
|
|
<StyledPageInfoContainer>
|
|
|
|
|
{icon && (
|
|
|
|
|
<StyledPageInfoIcon iconColor={iconColor}>{icon}</StyledPageInfoIcon>
|
|
|
|
|
)}
|
2025-11-28 10:46:14 +00:00
|
|
|
<StyledPageInfoTextContainer>
|
|
|
|
|
<StyledPageInfoTitleContainer>{title}</StyledPageInfoTitleContainer>
|
|
|
|
|
{label && <StyledPageInfoLabel>{label}</StyledPageInfoLabel>}
|
|
|
|
|
</StyledPageInfoTextContainer>
|
2025-11-24 10:23:08 +00:00
|
|
|
</StyledPageInfoContainer>
|
|
|
|
|
);
|
|
|
|
|
};
|