diff --git a/app/admin/page.tsx b/app/admin/page.tsx index 8d12c6b..8d03f12 100644 --- a/app/admin/page.tsx +++ b/app/admin/page.tsx @@ -3,6 +3,19 @@ import { useState, useEffect, useRef } from 'react'; import { Card, Portal, MediaItem, CardType } from '@/types'; import { EXTERNAL_LINK_ENABLED as EXTERNAL_LINK_DEFAULT } from '@/lib/config'; +import { CARD_LIMITS } from '@/lib/validation'; + +type CharCounterProps = { value: string | undefined; limit: number }; +function CharCounter({ value, limit }: CharCounterProps) { + const len = (value ?? '').length; + if (len < limit * 0.8) return null; + const overflow = len > limit; + return ( +
+ {len} / {limit} +
+ ); +} function StyledSelectTesto visualizzato come link cliccabile nel modale. Se vuoto, viene mostrata l’URL stessa.