import React, { useState } from "react"; import { Control, Controller, FieldValues } from "react-hook-form"; import { useTranslation } from "react-i18next"; import { FormGroup, Select, SelectOption, SelectVariant, Split, SplitItem, } from "@patternfly/react-core"; import { TimeSelector, Unit, } from "../../components/time-selector/TimeSelector"; import { HelpItem } from "../../components/help-enabler/HelpItem"; type TokenLifespanProps = { id: string; name: string; defaultValue: string; control: Control; units?: Unit[]; }; const never = "tokenLifespan.never"; const expires = "tokenLifespan.expires"; export const TokenLifespan = ({ id, name, defaultValue, control, units, }: TokenLifespanProps) => { const { t } = useTranslation("clients"); const [open, setOpen] = useState(false); return ( } > ( {typeof value === "number" && value !== -1 && ( )} )} /> ); };