mirror of
https://github.com/Sea-Haven-Industries/shoc-frontend-new.git
synced 2026-10-01 16:43:13 +00:00
Dispatchers can flag Aveta on Service and Notes and filter those rows without a site-level attribute.
19 lines
629 B
TypeScript
19 lines
629 B
TypeScript
/** Design: cell shows Service & Notes layout when note, extras, or Aveta exist. */
|
|
export function hasServiceNotesDetails(
|
|
serviceNotes?: string | null,
|
|
extraServices?: string[] | null,
|
|
avetaRequired?: boolean | null,
|
|
): boolean {
|
|
return (
|
|
Boolean(serviceNotes?.trim()) || (extraServices?.length ?? 0) > 0 || Boolean(avetaRequired)
|
|
);
|
|
}
|
|
|
|
/** 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)}…`;
|
|
}
|