Louis 031b3517dc
Fix: #1142 setting groups toggle does not turn off it's nested settings (#3681)
* fix: #1142 - Toggle off experimental toggle does not turn off gated features

* test: add tests
2024-09-17 18:17:23 +07:00

39 lines
1.2 KiB
TypeScript

import { Button } from '@janhq/joi'
import { useSetAtom } from 'jotai'
import ModalValidation, { modalValidationAtom } from './ModalConfirmReset'
import ResettingModal from './ResettingModal'
const FactoryReset = () => {
const setModalValidation = useSetAtom(modalValidationAtom)
return (
<div className="flex w-full flex-col items-start justify-between gap-4 border-b border-[hsla(var(--app-border))] py-4 first:pt-0 last:border-none sm:flex-row">
<div className="space-y-1">
<div className="flex gap-x-2">
<h6 className="font-semibold capitalize">
Reset to Factory Settings
</h6>
</div>
<p className="whitespace-pre-wrap font-medium leading-relaxed text-[hsla(var(--text-secondary))]">
Reset the application to its initial state, deleting all your usage
data, including conversation history. This action is irreversible and
recommended only if the application is in a corrupted state.
</p>
</div>
<Button
data-testid="reset-button"
theme="destructive"
onClick={() => setModalValidation(true)}
>
Reset
</Button>
<ModalValidation />
<ResettingModal />
</div>
)
}
export default FactoryReset