interface Props { type: string; firstId: string; lastId: string; prompt: string; } const previewLabel = (text: string) => { return <> "{text !== undefined ? text.replaceAll('\\n', ' ').split(' ').slice(0, 15).join(' ') : ""}..." } const label = (type: string, firstId: string, lastId: string) => { return `${type} #${firstId} ${firstId === lastId ? '' : `- #${lastId}`}`; } const ExerciseLabel: React.FC = ({type, firstId, lastId, prompt}) => { return (
{label(type, firstId, lastId)}
{previewLabel(prompt)}
); } export default ExerciseLabel;