'use client' import React from 'react' import { useTranslation } from 'react-i18next' import { RiAddLine } from '@remixicon/react' import Button from '@/app/components/base/button' import VariableModal from '@/app/components/workflow/panel/env-panel/variable-modal' import { PortalToFollowElem, PortalToFollowElemContent, PortalToFollowElemTrigger, } from '@/app/components/base/portal-to-follow-elem' import type { EnvironmentVariable } from '@/app/components/workflow/types' type Props = { open: boolean setOpen: (value: React.SetStateAction) => void env?: EnvironmentVariable onClose: () => void onSave: (env: EnvironmentVariable) => void } const VariableTrigger = ({ open, setOpen, env, onClose, onSave, }: Props) => { const { t } = useTranslation() return ( { setOpen(v => !v) open && onClose() }} placement='left-start' offset={{ mainAxis: 8, alignmentAxis: -104, }} > { setOpen(v => !v) open && onClose() }}> { onClose() setOpen(false) }} /> ) } export default VariableTrigger