init
This commit is contained in:
commit
ec53fcbe95
1905 changed files with 513762 additions and 0 deletions
19
components/messages/teamMemSaved.ts
Normal file
19
components/messages/teamMemSaved.ts
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
import type { SystemMemorySavedMessage } from '../../types/message.js'
|
||||
|
||||
/**
|
||||
* Returns the team-memory segment for the memory-saved UI, plus the count so
|
||||
* the caller can derive the private count without accessing teamCount itself.
|
||||
* Plain function (not a React component) so the React Compiler won't hoist
|
||||
* the teamCount property access for memoization. This module is only loaded
|
||||
* when feature('TEAMMEM') is true.
|
||||
*/
|
||||
export function teamMemSavedPart(
|
||||
message: SystemMemorySavedMessage,
|
||||
): { segment: string; count: number } | null {
|
||||
const count = message.teamCount ?? 0
|
||||
if (count === 0) return null
|
||||
return {
|
||||
segment: `${count} team ${count === 1 ? 'memory' : 'memories'}`,
|
||||
count,
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue