import { createCookie } from 'react-router'

import { ADMIN_COOKIES, USER_COOKIES } from '~/configs/cookies'

export const userTokenCookieConfig = createCookie(USER_COOKIES.token, {
  httpOnly: false,
  sameSite: 'lax',
  secure: process.env.NODE_ENV === 'production',
  secrets: [process.env.VITE_SALT_KEY || 'default-secret'],
  path: '/',
})

export const adminTokenCookieConfig = createCookie(ADMIN_COOKIES.token, {
  httpOnly: false,
  sameSite: 'lax',
  secure: process.env.NODE_ENV === 'production',
  secrets: [process.env.VITE_SALT_KEY || 'default-secret'],
  path: '/lg-admin',
})
