"use client"; import * as React from "react"; import { cn } from "./lib/utils"; export interface CharCounterProps extends React.HTMLAttributes { value: string; max: number; label?: string; } /** Character counter: threshold warning and limit clamp. */ export function CharCounter({ value, max, label, className, ...props }: CharCounterProps) { const count = value.length; const over = count > max; const near = !over && count >= max * 0.9; return ( {label && {label}} {count.toLocaleString("tr-TR")}/{max.toLocaleString("tr-TR")} {over && } ); }