2026-02-07 19:08:08 +09:00
|
|
|
export function truncateDescription(description: string, maxLength: number = 120): string {
|
|
|
|
|
if (!description) {
|
|
|
|
|
return description
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if (description.length <= maxLength) {
|
|
|
|
|
return description
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-07 19:13:35 +09:00
|
|
|
return description.slice(0, maxLength - 3) + "..."
|
2026-02-07 19:08:08 +09:00
|
|
|
}
|