diff --git a/src/client/lazy-app/Compress/Options/index.tsx b/src/client/lazy-app/Compress/Options/index.tsx index ede3b056..233b8c5a 100644 --- a/src/client/lazy-app/Compress/Options/index.tsx +++ b/src/client/lazy-app/Compress/Options/index.tsx @@ -18,6 +18,8 @@ import Select from './Select'; import { Options as QuantOptionsComponent } from 'features/processors/quantize/client'; import { Options as ResizeOptionsComponent } from 'features/processors/resize/client'; +import { generateCliInvocation } from '../../util/cli-invocation-generator'; + interface Props { mobileView: boolean; source?: SourceImage; @@ -97,6 +99,23 @@ export default class Options extends Component { ); }; + private onCreateCLIInvocation = () => { + if (!this.props.encoderState) { + return; + } + + try { + const cliInvocation = generateCliInvocation( + this.props.encoderState, + this.props.processorState, + ); + navigator.clipboard.writeText(cliInvocation); + } catch (e) { + // Show toast + console.error(e); + } + }; + render( { source, encoderState, processorState, onEncoderOptionsChange }: Props, { supportedEncoderMap }: State, @@ -110,7 +129,9 @@ export default class Options extends Component { {!encoderState ? null : (
-

Edit

+

+ Edit +