import { memo, useContext } from 'react'; import { CompactModeContext } from '../../App'; import { useI18n } from '../../i18n'; import styles from './UserShellMessage.module.css'; interface UserShellMessageProps { command: string; output: string; } export const UserShellMessage = memo(function UserShellMessage({ command, output, }: UserShellMessageProps) { const compactMode = useContext(CompactModeContext); const { t } = useI18n(); return (
{t('shell.command')} {command && {command}}
{compactMode ? (
{t('compact.hint')}
) : ( output &&
{output}
)}
); });