huridocs/uwazi

View on GitHub
app/react/V2/Routes/Settings/ParagraphExtraction/utils/getTemplateName.ts

Summary

Maintainability
A
0 mins
Test Coverage
import { Template } from 'app/apiResponseTypes';

const getTemplateName = (templates: Template[], targetId: string) => {
  const foundTemplate = templates.find(template => template._id === targetId);
  return foundTemplate?.name || targetId;
};

export { getTemplateName };