From 6ec259a0e71174651bae95d4628138bf6fd68742 Mon Sep 17 00:00:00 2001 From: kj_sh604 Date: Sun, 15 Mar 2026 16:19:35 -0400 Subject: refactor: packages/ --- .../dropdownMenu/DropdownMenuItemContentRadio.tsx | 51 ++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 packages/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.tsx (limited to 'packages/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.tsx') diff --git a/packages/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.tsx b/packages/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.tsx new file mode 100644 index 0000000..14bfe1a --- /dev/null +++ b/packages/excalidraw/components/dropdownMenu/DropdownMenuItemContentRadio.tsx @@ -0,0 +1,51 @@ +import { useDevice } from "../App"; +import { RadioGroup } from "../RadioGroup"; + +type Props = { + value: T; + shortcut?: string; + choices: { + value: T; + label: React.ReactNode; + ariaLabel?: string; + }[]; + onChange: (value: T) => void; + children: React.ReactNode; + name: string; +}; + +const DropdownMenuItemContentRadio = ({ + value, + shortcut, + onChange, + choices, + children, + name, +}: Props) => { + const device = useDevice(); + + return ( + <> +
+ + +
+ {shortcut && !device.editor.isMobile && ( +
+ {shortcut} +
+ )} + + ); +}; + +DropdownMenuItemContentRadio.displayName = "DropdownMenuItemContentRadio"; + +export default DropdownMenuItemContentRadio; -- cgit v1.2.3