2025-06-18 15:47:24 +02:00
|
|
|
import type { AliasDeprecationReason, IconDeprecationReason } from '../types.ts';
|
|
|
|
|
|
2024-11-08 16:47:53 +01:00
|
|
|
export default function deprecationReasonTemplate(
|
2025-06-18 15:47:24 +02:00
|
|
|
deprecationReason: AliasDeprecationReason | IconDeprecationReason,
|
|
|
|
|
{
|
|
|
|
|
componentName,
|
|
|
|
|
}: {
|
|
|
|
|
componentName: string;
|
|
|
|
|
iconName: string;
|
|
|
|
|
},
|
2024-05-22 13:08:34 +02:00
|
|
|
) {
|
|
|
|
|
switch (deprecationReason) {
|
|
|
|
|
case 'alias.typo':
|
2026-08-06 14:28:58 +02:00
|
|
|
return `Renamed because of typo, use {@link ${componentName}} instead.`;
|
2024-12-03 11:36:22 +01:00
|
|
|
case 'alias.duplicate':
|
2026-08-06 14:28:58 +02:00
|
|
|
return `The icon was combined with another icon that shares the same use case, use {@link ${componentName}} instead.`;
|
2025-06-18 15:47:24 +02:00
|
|
|
case 'alias.name':
|
2026-08-06 14:28:58 +02:00
|
|
|
return `The name of this icon was changed because it didn't meet our guidelines anymore, use {@link ${componentName}} instead.`;
|
2026-03-13 10:18:53 +01:00
|
|
|
default:
|
2025-07-30 16:52:50 +02:00
|
|
|
throw new Error(`Unknown deprecation reason: ${deprecationReason}`);
|
2024-05-22 13:08:34 +02:00
|
|
|
}
|
|
|
|
|
}
|