Files
twenty/packages/twenty-front/src/modules/keyboard-shortcut-menu/components/KeyboardShortcutMenuItem.tsx
T
Balaji Krishnamurthy 7a999c8476 Format date displayed in Releases section (#14183)
Closes #14177 

I noticed a `formatDisplayDate` file being used in `twenty-website` and
created the same one for `twenty-front` as well. Unit tests for the same
have been added.

<img width="1438" height="770" alt="image"
src="https://github.com/user-attachments/assets/5aa6eef5-19c5-4108-bf3f-c582d0ca1b59"
/>
<img width="1275" height="785" alt="image"
src="https://github.com/user-attachments/assets/20a87ba6-fca4-472c-a691-362901505303"
/>

---------

Co-authored-by: Félix Malfait <felix@twenty.com>
2025-09-04 17:27:31 +02:00

36 lines
1.1 KiB
TypeScript

import {
StyledItem,
StyledShortcutKey,
StyledShortcutKeyContainer,
} from '@/keyboard-shortcut-menu/components/KeyboardShortcutMenuStyles';
import { type Shortcut } from '@/keyboard-shortcut-menu/types/Shortcut';
import { t } from '@lingui/core/macro';
type KeyboardMenuItemProps = {
shortcut: Shortcut;
};
export const KeyboardMenuItem = ({ shortcut }: KeyboardMenuItemProps) => {
return (
<StyledItem>
{shortcut.label}
{shortcut.secondHotKey ? (
shortcut.areSimultaneous ? (
<StyledShortcutKeyContainer>
<StyledShortcutKey>{shortcut.firstHotKey}</StyledShortcutKey>
<StyledShortcutKey>{shortcut.secondHotKey}</StyledShortcutKey>
</StyledShortcutKeyContainer>
) : (
<StyledShortcutKeyContainer>
<StyledShortcutKey>{shortcut.firstHotKey}</StyledShortcutKey>
{t`then`}
<StyledShortcutKey>{shortcut.secondHotKey}</StyledShortcutKey>
</StyledShortcutKeyContainer>
)
) : (
<StyledShortcutKey>{shortcut.firstHotKey}</StyledShortcutKey>
)}
</StyledItem>
);
};