import { useSubmit } from "@remix-run/react"; import { InputGroup } from "~/components/primitives/InputGroup"; import { Label } from "~/components/primitives/Label"; import { Paragraph } from "~/components/primitives/Paragraph"; import { Select, SelectItem } from "~/components/primitives/Select"; import type { SessionDurationOption } from "~/services/sessionDuration.server"; interface SessionDurationSettingProps { currentValue: number; options: SessionDurationOption[]; orgCapSeconds: number | null; } export function SessionDurationSetting({ currentValue, options, orgCapSeconds, }: SessionDurationSettingProps) { const submit = useSubmit(); const orgCapOption = orgCapSeconds === null ? null : options.find((o) => o.value === orgCapSeconds); return (
Automatically log out after a period of time. {orgCapSeconds !== null ? ( <> {" "} Your organization caps this at {orgCapOption?.label ?? `${orgCapSeconds} seconds`}. ) : null}
); }