2026-08-24 15:16:51 -03:00
|
|
|
/** Design: cell shows Service & Notes layout when note, extras, or Aveta exist. */
|
2026-07-17 10:45:59 -03:00
|
|
|
export function hasServiceNotesDetails(
|
|
|
|
|
serviceNotes?: string | null,
|
|
|
|
|
extraServices?: string[] | null,
|
2026-08-24 15:16:51 -03:00
|
|
|
avetaRequired?: boolean | null,
|
2026-07-17 10:45:59 -03:00
|
|
|
): boolean {
|
2026-08-24 15:16:51 -03:00
|
|
|
return (
|
|
|
|
|
Boolean(serviceNotes?.trim()) || (extraServices?.length ?? 0) > 0 || Boolean(avetaRequired)
|
|
|
|
|
);
|
2026-07-17 10:45:59 -03:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 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)}…`;
|
|
|
|
|
}
|