From 396acf3bbbe00a192cb0ea0a9ccf91b1d8d2850b Mon Sep 17 00:00:00 2001 From: Fuwn <50817549+Fuwn@users.noreply.github.com> Date: Sat, 24 Jan 2026 13:09:50 +0000 Subject: Initial commit Created from https://vercel.com/new --- src/components/hooks/useSlug.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 src/components/hooks/useSlug.ts (limited to 'src/components/hooks/useSlug.ts') diff --git a/src/components/hooks/useSlug.ts b/src/components/hooks/useSlug.ts new file mode 100644 index 0000000..f795dfe --- /dev/null +++ b/src/components/hooks/useSlug.ts @@ -0,0 +1,14 @@ +import { useConfig } from '@/components/hooks/useConfig'; +import { LINKS_URL, PIXELS_URL } from '@/lib/constants'; + +export function useSlug(type: 'link' | 'pixel') { + const { linksUrl, pixelsUrl } = useConfig(); + + const hostUrl = type === 'link' ? linksUrl || LINKS_URL : pixelsUrl || PIXELS_URL; + + const getSlugUrl = (slug: string) => { + return `${hostUrl}/${slug}`; + }; + + return { getSlugUrl, hostUrl }; +} -- cgit v1.2.3