import classNames from 'classnames' import { useState } from 'react' import { Link } from 'react-router-dom' import { useRecoilState } from 'recoil' import IconCaretDown from '~/icons/compiled/CaretDown' import { useOrgParams } from '~/utils/organization' import { pluralize, pluralizeWithCount } from '~/utils/text' import { ActionMode, ActionLookupResult, ActionGroupLookupResult, } from '~/utils/types' import ListViewToggle, { actionsListViewMode } from '../ListViewToggle' import ActionsListGroup from './ActionsListGroup' import ActionsListItem from './ActionsListItem' export interface ActionsListProps { mode: ActionMode | 'anon-console' canRun?: boolean canConfigure?: boolean actions: ActionLookupResult[] archivedActions: ActionLookupResult[] groups?: ActionGroupLookupResult[] slugPrefix?: string showFullSlug?: boolean } export default function ActionsList(props: ActionsListProps) { const { orgEnvSlug } = useOrgParams() const [viewMode] = useRecoilState(actionsListViewMode) const [showArchived, setShowArchived] = useState(false) if (!props.actions.length && !props.groups?.length) return null return (
{pluralize(
props.archivedActions.length,
'This action has been archived but is still registered in code.',
'These actions have been archived but are still registered in code.'
)}
Remove archived actions from your code and redeploy to remove
them from the dashboard, or unarchive the actions to restore
them to the list above.
{pluralize(
props.archivedActions.length,
'This action has been archived in live mode.',
'These actions have been archived in live mode.'
)}
Remove archived actions from your code to remove them from the
dashboard, or unarchive actions in{' '}
live mode
{' '}
to restore them to the list above.