Files
lucide/tools/build-icons/utils/deprecationReasonTemplate.ts
KarsaandJakob Guddas a87bc9b15b fix(icons): deprecated swiss franc icons (#4799)
* fix(icons): deprecated swiss franc icons & refined icon deprecation reasons

* Update tools/build-icons/utils/deprecationReasonTemplate.ts

Co-authored-by: Jakob Guddas <github@jguddas.de>

* fix(icons): replace icon.obsolete => icon.use-case

---------

Co-authored-by: Jakob Guddas <github@jguddas.de>
2026-09-04 14:04:24 +02:00

27 lines
1.0 KiB
TypeScript

import type { AliasDeprecationReason, IconDeprecationReason } from '../types.ts';
export default function deprecationReasonTemplate(
deprecationReason: AliasDeprecationReason | IconDeprecationReason,
{
componentName,
}: {
componentName: string;
iconName: string;
},
) {
switch (deprecationReason) {
case 'alias.typo':
return `Renamed because of typo, use {@link ${componentName}} instead.`;
case 'alias.duplicate':
return `The icon was combined with another icon that shares the same use case, use {@link ${componentName}} instead.`;
case 'alias.name':
return `The name of this icon was changed because it didn't meet our guidelines anymore, use {@link ${componentName}} instead.`;
case 'icon.design':
return `Removed because the icon didn't meet our design guidelines.`;
case 'icon.use-case':
return `Removed because the depicted concept became obsolete and no longer had relevant use cases.`;
default:
throw new Error(`Unknown deprecation reason: ${deprecationReason}`);
}
}