import { useState } from 'react' import { Link } from 'react-router-dom' import { useMutation, useQueryClient } from '@tanstack/react-query' import { ArrowLeft, BookOpenText, Globe2, Loader2, Plus, Trash2 } from 'lucide-react' import { screenApi } from './api' import { useAliases } from './queries' import { screenBrand } from './brand' import { Badge, Panel } from '../../components/ui' import { ToolHeader } from '../../components/ToolHeader' // The acronym and term expansion manager: the global GovCon and DoD seed every tenant gets, plus // this organization's own additions. Terms normalize requirement and resume skill names during // matching, so JWICS matches Joint Worldwide Intelligence Communications System. export function AliasSettings() { const aliases = useAliases() const qc = useQueryClient() const [alias, setAlias] = useState('') const [expansion, setExpansion] = useState('') const add = useMutation({ mutationFn: () => screenApi.addAlias(alias, expansion), onSuccess: () => { setAlias('') setExpansion('') void qc.invalidateQueries({ queryKey: ['screenmatch', 'aliases'] }) }, }) const remove = useMutation({ mutationFn: (id: string) => screenApi.deleteAlias(id), onSuccess: () => void qc.invalidateQueries({ queryKey: ['screenmatch', 'aliases'] }), }) const terms = aliases.data?.terms ?? [] const globalTerms = terms.filter((t) => t.global) const orgTerms = terms.filter((t) => !t.global) return (
Back to Screening Queue
{add.isError &&

{(add.error as Error).message}

}
{aliases.isLoading ? (

Loading…

) : orgTerms.length === 0 ? (

No custom terms yet. Terms you add apply on top of the platform seed below.

) : (
    {orgTerms.map((t) => (
  • {t.alias} expands to {t.expansion}
  • ))}
)}
{globalTerms.map((t) => (
{t.alias} {t.expansion} seed
))}
) }