Replace hideSwitch by showSwitch

This commit is contained in:
Cédric FAMIBELLE-PRONZOLA
2022-03-27 04:51:37 +04:00
parent 7ca1b4e42e
commit 158285e6f8
2 changed files with 6 additions and 7 deletions
+3 -3
View File
@@ -73,7 +73,7 @@ const Alert = forwardRef(function Alert(props, ref) {
const RemoveTooltip = Tooltip
function EkriTeks({selectedTeks, setSelectedTeks}) {
function EkriTeks({canAutoTranslate, selectedTeks, setSelectedTeks}) {
const {data: session} = useSession()
const {jwt, user} = session
const [teksEkri, setTeksEkri] = useState({awtis: '', tit: '', transkripsyon: ''})
@@ -367,11 +367,10 @@ function EkriTeks({selectedTeks, setSelectedTeks}) {
))}
</form>
<AjouteTradiksyon
hideSwitch={Boolean(currentTeksId)}
showSwitch={Boolean(canAutoTranslate) && Boolean(!currentTeksId)}
disableSwitch={tradiksyon.fr === ''}
tradiksyonOtomatik={tradiksyonOtomatik}
setTradiksyonOtomatik={setTradiksyonOtomatik}
canAutoTranslate={user.canAutoTranslate}
chwaLang={kiChawLang}
setChwaLang={setKiChwalang}
/>
@@ -425,6 +424,7 @@ EkriTeks.defaultProps = {
}
EkriTeks.propTypes = {
canAutoTranslate: PropTypes.bool.isRequired,
selectedTeks: PropTypes.object,
setSelectedTeks: PropTypes.func.isRequired,
}