import { useState } from 'react'; import { Collapse } from '@snowballtools/material-tailwind-react-fork'; import EditEnvironmentVariableRow from './EditEnvironmentVariableRow'; import { Environment, EnvironmentVariable } from 'gql-client'; import { ChevronDownSmallIcon, ChevronUpSmallIcon, } from 'components/shared/CustomIcon'; interface DisplayEnvironmentVariablesProps { environment: Environment; variables: EnvironmentVariable[]; onUpdate: () => Promise; } const DisplayEnvironmentVariables = ({ environment, variables, onUpdate, }: DisplayEnvironmentVariablesProps) => { const [openCollapse, setOpenCollapse] = useState(false); return ( <>
setOpenCollapse((cur) => !cur)} > {openCollapse ? : }
{environment}
{variables.length} variables
{variables.length === 0 ? (
No environment variables added yet. Once you add them, they'll show up here.
) : ( variables.map((variable: EnvironmentVariable) => { return ( ); }) )}
); }; export default DisplayEnvironmentVariables;