import type { ReactElement } from "react"; import { Text, View, type StyleProp, type TextStyle, type ViewStyle } from "react-native"; import { StyleSheet } from "react-native-unistyles"; import { formatShortcut, type ShortcutKey } from "@/utils/format-shortcut"; import { getShortcutOs } from "@/utils/shortcut-platform"; export function Shortcut({ keys, style, textStyle, }: { keys: ShortcutKey[]; style?: StyleProp; textStyle?: StyleProp; }): ReactElement { return ( {formatShortcut(keys, getShortcutOs())} ); } const styles = StyleSheet.create((theme) => ({ root: { paddingHorizontal: theme.spacing[1], paddingVertical: 2, borderRadius: theme.borderRadius.md, backgroundColor: theme.colors.surface2, borderWidth: theme.borderWidth[1], borderColor: theme.colors.borderAccent, }, text: { fontSize: theme.fontSize.xs, fontWeight: theme.fontWeight.normal, color: theme.colors.foregroundMuted, }, }));