first commit

This commit is contained in:
Beyhan Oğur
2026-04-26 21:46:42 +03:00
commit 2a5b661443
202 changed files with 49770 additions and 0 deletions

16
frontend/hooks/useSlug.ts Normal file
View File

@@ -0,0 +1,16 @@
import { useCallback } from 'react';
export const useSlug = () => {
const slugify = useCallback((text: string) => {
return text
.toString()
.toLowerCase()
.trim()
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/&/g, '-and-') // Replace & with 'and'
.replace(/[^\w-]+/g, '') // Remove all non-word chars
.replace(/--+/g, '-'); // Replace multiple - with single -
}, []);
return { slugify };
};