mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-03 17:53:14 +00:00
17 lines
551 B
TypeScript
17 lines
551 B
TypeScript
|
|
/** Design: cell shows Service & Notes layout when note or extras exist. */
|
||
|
|
export function hasServiceNotesDetails(
|
||
|
|
serviceNotes?: string | null,
|
||
|
|
extraServices?: string[] | null,
|
||
|
|
): boolean {
|
||
|
|
return Boolean(serviceNotes?.trim()) || (extraServices?.length ?? 0) > 0;
|
||
|
|
}
|
||
|
|
|
||
|
|
/** Truncate note for the board cell subtitle (~30 chars, design). */
|
||
|
|
export function truncateServiceNotesPreview(note: string, max = 30): string {
|
||
|
|
const trimmed = note.trim();
|
||
|
|
if (trimmed.length <= max) {
|
||
|
|
return trimmed;
|
||
|
|
}
|
||
|
|
return `${trimmed.slice(0, max)}…`;
|
||
|
|
}
|