| 1 | 'use client' |
| 2 | |
| 3 | import { authClient } from '@/lib/auth-client' |
| 4 | import { |
| 5 | type CustomFieldDefinition, |
| 6 | formatCustomFieldValue, |
| 7 | } from '@/lib/custom-fields' |
| 8 | |
| 9 | export function CustomValuesInline({ |
| 10 | customFields, |
| 11 | values, |
| 12 | }: { |
| 13 | customFields: CustomFieldDefinition |
| 14 | values: Record |
| 15 | }) { |
| 16 | const { data: |
| 17 | const timeZone = |
| 18 | if (!values || |
| 19 | return null |
| 20 | } |
| 21 | const items: |
| 22 | for (const def |
| 23 | const formatted = |
| 24 | if (formatted !== |
| 25 | items.push({ |
| 26 | } |
| 27 | } |
| 28 | if (items.length |
| 29 | return null |
| 30 | } |
| 31 | return ( |
| 32 | <div className='mt-1.5 flex flex-wrap gap-1.5 |
| 33 | {items.map(( |
| 34 | <span |
| 35 | className='inline-flex items-center gap-1 rounded-md border bg-muted/40 px-1.5 py-0.5 text-[11px] leading-tight' |
| 36 | key={it.id |
| 37 | > |
| 38 | <span className='text-muted-foreground |
| 39 | {/* Date/datetime values are formatted with the runtime locale and |
| 40 | timezone, so server and client output can differ — suppress the |
| 41 | expected hydration mismatch. */} |
| 42 | <span |
| 43 | className='font-medium text-foreground' |
| 44 | suppressHydrationWarning |
| 45 | > |
| 46 | {it.value} |
| 47 | </span> |
| 48 | </span> |
| 49 | ))} |
| 50 | </div> |
| 51 | ) |
| 52 | } |