mirror of
https://github.com/lucide-icons/lucide.git
synced 2026-11-16 14:18:29 +00:00
* 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>
27 lines
1.0 KiB
TypeScript
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}`);
|
|
}
|
|
}
|