- Updated translation utility to improve consistency and reduce redundancy. - Removed deprecated useTrans hook and related code. - Introduced a new Zustand store for managing translations and locale settings. - Cleaned up unused hooks and files related to localization.
19 lines
652 B
TypeScript
19 lines
652 B
TypeScript
// * Other
|
|
import trans from "@/hooks/use-translations";
|
|
|
|
export default function WordCounter({ value }: { value: string }) {
|
|
const characters = value.length;
|
|
const words = characters ? value.split(" ").length : 0;
|
|
return (
|
|
<section className="flex justify-around w-full gap-1.5 bg-secondary rounded-md py-1">
|
|
<p className="text-sm text-muted-foreground mx-auto w-fit">
|
|
{trans("uwil-backend::back.characters")}
|
|
<span>{characters}</span>
|
|
</p>
|
|
<p className="text-sm text-muted-foreground mx-auto w-fit">
|
|
{trans("uwil-backend::back.words")}
|
|
<span>{words}</span>
|
|
</p>
|
|
</section>
|
|
);
|
|
}
|