Files
twenty_crm/packages/twenty-front/src/modules/command-menu/components/CommandGroup.tsx
Raphaël Bosi 988ab9697c Command menu list design updates (#10075)
- Add 2px gap between items
- Update `MenuItemCommand` style to distinguish `hovered` and `selected`
states



https://github.com/user-attachments/assets/d1e29f07-32e7-4ace-9aa1-0ea83712f052
2025-02-07 16:55:24 +01:00

38 lines
1.0 KiB
TypeScript

import styled from '@emotion/styled';
import React from 'react';
const StyledGroupHeading = styled.div`
align-items: center;
color: ${({ theme }) => theme.font.color.light};
font-size: ${({ theme }) => theme.font.size.xs};
font-weight: ${({ theme }) => theme.font.weight.semiBold};
padding-bottom: ${({ theme }) => theme.spacing(1)};
padding-left: ${({ theme }) => theme.spacing(2)};
padding-right: ${({ theme }) => theme.spacing(1)};
padding-top: ${({ theme }) => theme.spacing(2)};
user-select: none;
`;
const StyledGroup = styled.div`
display: flex;
flex-direction: column;
gap: ${({ theme }) => theme.spacing(0.5)};
`;
type CommandGroupProps = {
heading: string;
children: React.ReactNode | React.ReactNode[];
};
export const CommandGroup = ({ heading, children }: CommandGroupProps) => {
if (!children || !React.Children.count(children)) {
return null;
}
return (
<>
<StyledGroupHeading>{heading}</StyledGroupHeading>
<StyledGroup>{children}</StyledGroup>
</>
);
};