mirror of
https://github.com/stablyai/orca.git
synced 2026-11-17 19:34:29 +00:00
* chore(lint): bump oxlint to 1.91, add perf lint rules and perf audits * fix(lint): await promises returned inside try/catch/finally for return-await Prepare typescript/return-await with error-handling-correctness-only: await returns whose catch or finally was meant to cover them, and suppress the eight sites where the catch must not re-handle the returned promise. * chore(lint): enable return-await (error-handling-correctness-only); exempt secondary-scan directives in the changed gate * refactor(mobile): move file preview discard modal into its own module Keeps MobileFilePreviewScreen under the 400-line limit after merging main. --------- Co-authored-by: m4air <m4air@m4airs-MacBook-Air.local>
31 lines
975 B
TypeScript
31 lines
975 B
TypeScript
import { ConfirmModal } from '../components/ConfirmModal'
|
|
import { useMobileTranslation } from '../i18n/use-mobile-translation'
|
|
|
|
export function MobileFilePreviewDiscardModal(props: {
|
|
visible: boolean
|
|
saving: boolean
|
|
onConfirm: () => void
|
|
onCancel: () => void
|
|
}) {
|
|
const t = useMobileTranslation()
|
|
return (
|
|
<ConfirmModal
|
|
visible={props.visible}
|
|
title={t('files.filePreviewScreen.discardTitle', 'Discard changes?')}
|
|
message={
|
|
props.saving
|
|
? t(
|
|
'files.filePreviewScreen.discardMessageSaving',
|
|
'The save in progress may not finish. Unsaved edits will be lost.'
|
|
)
|
|
: t('files.filePreviewScreen.discardMessage', 'Unsaved edits will be lost.')
|
|
}
|
|
confirmLabel={t('files.filePreviewScreen.discard', 'Discard')}
|
|
cancelLabel={t('files.filePreviewScreen.stay', 'Stay')}
|
|
destructive
|
|
onConfirm={props.onConfirm}
|
|
onCancel={props.onCancel}
|
|
/>
|
|
)
|
|
}
|