import ProfilePage from '@/components/Profile/pages/Profile';
import routes, { profilePrefix } from '@/routes'
import { Route, Routes } from 'react-router-dom'
import Layout from './Layout';
import SubscriptionsPage from '@/components/Profile/pages/Subscriptions';

const removePrefix = (path: string) => path.replace(profilePrefix, "");

function ProfileRoutes() {

    return (
        <Routes>
            <Route element={<Layout />}>
                <Route
                    path={removePrefix(routes.client.profile())}
                    element={
                        <ProfilePage />
                    }
                />
                <Route
                    path={removePrefix(routes.client.profileSubscriptions())}
                    element={
                        <SubscriptionsPage />
                    }
                />
            </Route>
        </Routes>
    )
}

export default ProfileRoutes