Release 2025-05-19
This commit is contained in:
@@ -1,68 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
import type { AccountStatusChange } from '@prisma/client'
|
||||
|
||||
type AccountStatusChangeInfo<T extends string | null | undefined = string> = {
|
||||
value: T
|
||||
label: string
|
||||
notificationTitle: string
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: accountStatusChanges,
|
||||
dataObject: accountStatusChangesById,
|
||||
getFn: getAccountStatusChangeInfo,
|
||||
zodEnumById: accountStatusChangesZodEnumById,
|
||||
} = makeHelpersForOptions(
|
||||
'value',
|
||||
(value): AccountStatusChangeInfo<typeof value> => ({
|
||||
value,
|
||||
label: value ? transformCase(value.replaceAll('_', ' '), 'title') : String(value),
|
||||
notificationTitle: value ? transformCase(value.replaceAll('_', ' '), 'title') : String(value),
|
||||
}),
|
||||
[
|
||||
{
|
||||
value: 'ADMIN_TRUE',
|
||||
label: 'Admin role granted',
|
||||
notificationTitle: 'Admin role granted',
|
||||
},
|
||||
{
|
||||
value: 'ADMIN_FALSE',
|
||||
label: 'Admin role revoked',
|
||||
notificationTitle: 'Admin role revoked',
|
||||
},
|
||||
{
|
||||
value: 'VERIFIED_TRUE',
|
||||
label: 'Account verified',
|
||||
notificationTitle: 'Your account is now verified',
|
||||
},
|
||||
{
|
||||
value: 'VERIFIED_FALSE',
|
||||
label: 'Account unverified',
|
||||
notificationTitle: 'Your account is no longer verified',
|
||||
},
|
||||
{
|
||||
value: 'VERIFIER_TRUE',
|
||||
label: 'Verifier role granted',
|
||||
notificationTitle: 'Verifier role granted',
|
||||
},
|
||||
{
|
||||
value: 'VERIFIER_FALSE',
|
||||
label: 'Verifier role revoked',
|
||||
notificationTitle: 'Verifier role revoked',
|
||||
},
|
||||
{
|
||||
value: 'SPAMMER_TRUE',
|
||||
label: 'Banned',
|
||||
notificationTitle: 'Your account has been banned',
|
||||
},
|
||||
{
|
||||
value: 'SPAMMER_FALSE',
|
||||
label: 'Unbanned',
|
||||
notificationTitle: 'Your account is no longer banned',
|
||||
},
|
||||
] as const satisfies AccountStatusChangeInfo<AccountStatusChange>[]
|
||||
)
|
||||
|
||||
export type AccountStatusChangeType = (typeof accountStatusChanges)[number]['value']
|
||||
@@ -1,60 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
import type { AttributeCategory } from '@prisma/client'
|
||||
|
||||
type AttributeCategoryInfo<T extends string | null | undefined = string> = {
|
||||
value: T
|
||||
slug: string
|
||||
label: string
|
||||
icon: string
|
||||
classNames: {
|
||||
icon: string
|
||||
}
|
||||
order: number
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: attributeCategories,
|
||||
dataObject: attributeCategoriesById,
|
||||
getFn: getAttributeCategoryInfo,
|
||||
getFnSlug: getAttributeCategoryInfoBySlug,
|
||||
zodEnumBySlug: attributeCategoriesZodEnumBySlug,
|
||||
zodEnumById: attributeCategoriesZodEnumById,
|
||||
keyToSlug: attributeCategoryIdToSlug,
|
||||
slugToKey: attributeCategorySlugToId,
|
||||
} = makeHelpersForOptions(
|
||||
'value',
|
||||
(value): AttributeCategoryInfo<typeof value> => ({
|
||||
value,
|
||||
slug: value ? value.toLowerCase() : '',
|
||||
label: value ? transformCase(value, 'title') : String(value),
|
||||
icon: 'ri:shield-fill',
|
||||
classNames: {
|
||||
icon: 'text-current/60',
|
||||
},
|
||||
order: Infinity,
|
||||
}),
|
||||
[
|
||||
{
|
||||
value: 'PRIVACY',
|
||||
slug: 'privacy',
|
||||
label: 'Privacy',
|
||||
icon: 'ri:shield-user-fill',
|
||||
classNames: {
|
||||
icon: 'text-blue-500',
|
||||
},
|
||||
order: 1,
|
||||
},
|
||||
{
|
||||
value: 'TRUST',
|
||||
slug: 'trust',
|
||||
label: 'Trust',
|
||||
icon: 'ri:shield-check-fill',
|
||||
classNames: {
|
||||
icon: 'text-green-500',
|
||||
},
|
||||
order: 2,
|
||||
},
|
||||
] as const satisfies AttributeCategoryInfo<AttributeCategory>[]
|
||||
)
|
||||
@@ -1,110 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
import type { AttributeType } from '@prisma/client'
|
||||
|
||||
type AttributeTypeInfo<T extends string | null | undefined = string> = {
|
||||
value: T
|
||||
slug: string
|
||||
label: string
|
||||
icon: string
|
||||
order: number
|
||||
classNames: {
|
||||
container: string
|
||||
subcontainer: string
|
||||
text: string
|
||||
textLight: string
|
||||
icon: string
|
||||
button: string
|
||||
}
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: attributeTypes,
|
||||
dataObject: attributeTypesById,
|
||||
getFn: getAttributeTypeInfo,
|
||||
getFnSlug: getAttributeTypeInfoBySlug,
|
||||
zodEnumBySlug: attributeTypesZodEnumBySlug,
|
||||
zodEnumById: attributeTypesZodEnumById,
|
||||
keyToSlug: attributeTypeIdToSlug,
|
||||
slugToKey: attributeTypeSlugToId,
|
||||
} = makeHelpersForOptions(
|
||||
'value',
|
||||
(value): AttributeTypeInfo<typeof value> => ({
|
||||
value,
|
||||
slug: value ? value.toLowerCase() : '',
|
||||
label: value ? transformCase(value, 'title') : String(value),
|
||||
icon: 'ri:question-line',
|
||||
order: Infinity,
|
||||
classNames: {
|
||||
container: 'bg-current/30',
|
||||
subcontainer: 'bg-current/5 border-current/30',
|
||||
text: 'text-current/60',
|
||||
textLight: 'text-current/40',
|
||||
icon: 'text-current/60',
|
||||
button: 'bg-current/80 text-current/100 hover:bg-current/50',
|
||||
},
|
||||
}),
|
||||
[
|
||||
{
|
||||
value: 'BAD',
|
||||
slug: 'bad',
|
||||
label: 'Bad',
|
||||
icon: 'ri:close-line',
|
||||
order: 1,
|
||||
classNames: {
|
||||
container: 'bg-red-600/30',
|
||||
subcontainer: 'bg-red-600/5 border-red-600/30',
|
||||
text: 'text-red-200',
|
||||
textLight: 'text-red-100',
|
||||
icon: 'text-red-400',
|
||||
button: 'bg-red-200 text-red-900 hover:bg-red-50',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: 'WARNING',
|
||||
slug: 'warning',
|
||||
label: 'Warning',
|
||||
icon: 'ri:alert-line',
|
||||
order: 2,
|
||||
classNames: {
|
||||
container: 'bg-yellow-600/30',
|
||||
subcontainer: 'bg-yellow-600/5 border-yellow-600/30',
|
||||
text: 'text-yellow-200',
|
||||
textLight: 'text-amber-100',
|
||||
icon: 'text-yellow-400',
|
||||
button: 'bg-amber-100 text-amber-900 hover:bg-amber-50',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: 'GOOD',
|
||||
slug: 'good',
|
||||
label: 'Good',
|
||||
icon: 'ri:check-line',
|
||||
order: 3,
|
||||
classNames: {
|
||||
container: 'bg-green-600/30',
|
||||
subcontainer: 'bg-green-600/5 border-green-600/30',
|
||||
text: 'text-green-200',
|
||||
textLight: 'text-green-100',
|
||||
icon: 'text-green-400',
|
||||
button: 'bg-green-200 text-green-900 hover:bg-green-50',
|
||||
},
|
||||
},
|
||||
{
|
||||
value: 'INFO',
|
||||
slug: 'info',
|
||||
label: 'Info',
|
||||
icon: 'ri:information-line',
|
||||
order: 4,
|
||||
classNames: {
|
||||
container: 'bg-blue-600/30',
|
||||
subcontainer: 'bg-blue-600/5 border-blue-600/30',
|
||||
text: 'text-blue-200',
|
||||
textLight: 'text-blue-100',
|
||||
icon: 'text-blue-400',
|
||||
button: 'bg-blue-200 text-blue-900 hover:bg-blue-50',
|
||||
},
|
||||
},
|
||||
] as const satisfies AttributeTypeInfo<AttributeType>[]
|
||||
)
|
||||
@@ -1,92 +0,0 @@
|
||||
export const SEARCH_PARAM_CHARACTERS_NO_ESCAPE = [
|
||||
'a',
|
||||
'b',
|
||||
'c',
|
||||
'd',
|
||||
'e',
|
||||
'f',
|
||||
'g',
|
||||
'h',
|
||||
'i',
|
||||
'j',
|
||||
'k',
|
||||
'l',
|
||||
'm',
|
||||
'n',
|
||||
'o',
|
||||
'p',
|
||||
'q',
|
||||
'r',
|
||||
's',
|
||||
't',
|
||||
'u',
|
||||
'v',
|
||||
'w',
|
||||
'x',
|
||||
'y',
|
||||
'z',
|
||||
'A',
|
||||
'B',
|
||||
'C',
|
||||
'D',
|
||||
'E',
|
||||
'F',
|
||||
'G',
|
||||
'H',
|
||||
'I',
|
||||
'J',
|
||||
'K',
|
||||
'L',
|
||||
'M',
|
||||
'N',
|
||||
'O',
|
||||
'P',
|
||||
'Q',
|
||||
'R',
|
||||
'S',
|
||||
'T',
|
||||
'U',
|
||||
'V',
|
||||
'W',
|
||||
'X',
|
||||
'Y',
|
||||
'Z',
|
||||
'0',
|
||||
'1',
|
||||
'2',
|
||||
'3',
|
||||
'4',
|
||||
'5',
|
||||
'6',
|
||||
'7',
|
||||
'8',
|
||||
'9',
|
||||
'-',
|
||||
'_',
|
||||
'.',
|
||||
'~',
|
||||
] as const
|
||||
|
||||
export const LOWERCASE_VOWEL_CHARACTERS = ['a', 'e', 'i', 'o', 'u'] as const
|
||||
export const LOWERCASE_CONSONANT_CHARACTERS = [
|
||||
'b',
|
||||
'c',
|
||||
'd',
|
||||
'f',
|
||||
'g',
|
||||
'h',
|
||||
'j',
|
||||
'k',
|
||||
'l',
|
||||
'm',
|
||||
'n',
|
||||
'p',
|
||||
'r',
|
||||
's',
|
||||
't',
|
||||
'v',
|
||||
'w',
|
||||
'y',
|
||||
'z',
|
||||
] as const
|
||||
export const DIGIT_CHARACTERS = ['0', '1', '2', '3', '4', '5', '6', '7', '8', '9'] as const
|
||||
@@ -1,57 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
import type { CommentStatus } from '@prisma/client'
|
||||
|
||||
type CommentStatusInfo<T extends string | null | undefined = string> = {
|
||||
id: T
|
||||
icon: string
|
||||
label: string
|
||||
creativeWorkStatus: string | undefined
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: commentStatus,
|
||||
dataObject: commentStatusById,
|
||||
getFn: getCommentStatusInfo,
|
||||
} = makeHelpersForOptions(
|
||||
'id',
|
||||
(id): CommentStatusInfo<typeof id> => ({
|
||||
id,
|
||||
icon: 'ri:question-line',
|
||||
label: id ? transformCase(id, 'title') : String(id),
|
||||
creativeWorkStatus: undefined,
|
||||
}),
|
||||
[
|
||||
{
|
||||
id: 'PENDING',
|
||||
icon: 'ri:question-line',
|
||||
label: 'Pending',
|
||||
creativeWorkStatus: 'Deleted',
|
||||
},
|
||||
{
|
||||
id: 'HUMAN_PENDING',
|
||||
icon: 'ri:question-line',
|
||||
label: 'Pending 2',
|
||||
creativeWorkStatus: 'Deleted',
|
||||
},
|
||||
{
|
||||
id: 'VERIFIED',
|
||||
icon: 'ri:check-line',
|
||||
label: 'Verified',
|
||||
creativeWorkStatus: 'Verified',
|
||||
},
|
||||
{
|
||||
id: 'REJECTED',
|
||||
icon: 'ri:close-line',
|
||||
label: 'Rejected',
|
||||
creativeWorkStatus: 'Deleted',
|
||||
},
|
||||
{
|
||||
id: 'APPROVED',
|
||||
icon: 'ri:check-line',
|
||||
label: 'Approved',
|
||||
creativeWorkStatus: 'Active',
|
||||
},
|
||||
] as const satisfies CommentStatusInfo<CommentStatus>[]
|
||||
)
|
||||
@@ -1,68 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
import type { CommentStatusChange } from '@prisma/client'
|
||||
|
||||
type CommentStatusChangeInfo<T extends string | null | undefined = string> = {
|
||||
value: T
|
||||
label: string
|
||||
notificationTitle: string
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: commentStatusChanges,
|
||||
dataObject: commentStatusChangesById,
|
||||
getFn: getCommentStatusChangeInfo,
|
||||
zodEnumById: commentStatusChangesZodEnumById,
|
||||
} = makeHelpersForOptions(
|
||||
'value',
|
||||
(value): CommentStatusChangeInfo<typeof value> => ({
|
||||
value,
|
||||
label: value ? transformCase(value.replaceAll('_', ' '), 'title') : String(value),
|
||||
notificationTitle: value ? transformCase(value.replaceAll('_', ' '), 'title') : String(value),
|
||||
}),
|
||||
[
|
||||
{
|
||||
value: 'MARKED_AS_SPAM',
|
||||
label: 'Marked as spam',
|
||||
notificationTitle: 'was marked as spam',
|
||||
},
|
||||
{
|
||||
value: 'UNMARKED_AS_SPAM',
|
||||
label: 'Unmarked as spam',
|
||||
notificationTitle: 'is no longer marked as spam',
|
||||
},
|
||||
{
|
||||
value: 'MARKED_FOR_ADMIN_REVIEW',
|
||||
label: 'Marked for admin review',
|
||||
notificationTitle: 'was marked for admin review',
|
||||
},
|
||||
{
|
||||
value: 'UNMARKED_FOR_ADMIN_REVIEW',
|
||||
label: 'Unmarked for admin review',
|
||||
notificationTitle: 'is no longer marked for admin review',
|
||||
},
|
||||
{
|
||||
value: 'STATUS_CHANGED_TO_APPROVED',
|
||||
label: 'Approved',
|
||||
notificationTitle: 'was approved',
|
||||
},
|
||||
{
|
||||
value: 'STATUS_CHANGED_TO_VERIFIED',
|
||||
label: 'Verified',
|
||||
notificationTitle: 'was verified',
|
||||
},
|
||||
{
|
||||
value: 'STATUS_CHANGED_TO_REJECTED',
|
||||
label: 'Rejected',
|
||||
notificationTitle: 'was rejected',
|
||||
},
|
||||
{
|
||||
value: 'STATUS_CHANGED_TO_PENDING',
|
||||
label: 'Pending',
|
||||
notificationTitle: 'is now pending',
|
||||
},
|
||||
] as const satisfies CommentStatusChangeInfo<CommentStatusChange>[]
|
||||
)
|
||||
|
||||
export type CommentStatusChangeType = (typeof commentStatusChanges)[number]['value']
|
||||
@@ -1,143 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
import type { Prisma } from '@prisma/client'
|
||||
|
||||
type CommentStatusFilterInfo<T extends string | null | undefined = string> = {
|
||||
value: T
|
||||
label: string
|
||||
whereClause: Prisma.CommentWhereInput
|
||||
styles: {
|
||||
filter: string
|
||||
badge: string
|
||||
}
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: commentStatusFilters,
|
||||
dataObject: commentStatusFiltersById,
|
||||
getFn: getCommentStatusFilterInfo,
|
||||
zodEnumById: commentStatusFiltersZodEnum,
|
||||
} = makeHelpersForOptions(
|
||||
'value',
|
||||
(value): CommentStatusFilterInfo<typeof value> => ({
|
||||
value,
|
||||
label: value ? transformCase(value, 'title') : String(value),
|
||||
whereClause: {},
|
||||
styles: {
|
||||
filter: 'border-zinc-700 transition-colors hover:border-green-500/50',
|
||||
badge: '',
|
||||
},
|
||||
}),
|
||||
[
|
||||
{
|
||||
label: 'All',
|
||||
value: 'all',
|
||||
whereClause: {},
|
||||
styles: {
|
||||
filter: 'border-green-500 bg-green-500/20 text-green-400',
|
||||
badge: '',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Pending',
|
||||
value: 'pending',
|
||||
whereClause: {
|
||||
OR: [{ status: 'PENDING' }, { status: 'HUMAN_PENDING' }],
|
||||
},
|
||||
styles: {
|
||||
filter: 'border-blue-500 bg-blue-500/20 text-blue-400',
|
||||
badge: 'rounded-sm bg-blue-500/20 px-2 py-0.5 text-[12px] font-medium text-blue-500',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Rejected',
|
||||
value: 'rejected',
|
||||
whereClause: {
|
||||
status: 'REJECTED',
|
||||
},
|
||||
styles: {
|
||||
filter: 'border-red-500 bg-red-500/20 text-red-400',
|
||||
badge: 'rounded-sm bg-red-500/20 px-2 py-0.5 text-[12px] font-medium text-red-500',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Suspicious',
|
||||
value: 'suspicious',
|
||||
whereClause: {
|
||||
suspicious: true,
|
||||
},
|
||||
styles: {
|
||||
filter: 'border-red-500 bg-red-500/20 text-red-400',
|
||||
badge: 'rounded-sm bg-red-500/20 px-2 py-0.5 text-[12px] font-medium text-red-500',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Verified',
|
||||
value: 'verified',
|
||||
whereClause: {
|
||||
status: 'VERIFIED',
|
||||
},
|
||||
styles: {
|
||||
filter: 'border-blue-500 bg-blue-500/20 text-blue-400',
|
||||
badge: 'rounded-sm bg-blue-500/20 px-2 py-0.5 text-[12px] font-medium text-blue-500',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Approved',
|
||||
value: 'approved',
|
||||
whereClause: {
|
||||
status: 'APPROVED',
|
||||
},
|
||||
styles: {
|
||||
filter: 'border-green-500 bg-green-500/20 text-green-400',
|
||||
badge: 'rounded-sm bg-green-500/20 px-2 py-0.5 text-[12px] font-medium text-green-500',
|
||||
},
|
||||
},
|
||||
{
|
||||
label: 'Needs Review',
|
||||
value: 'needs-review',
|
||||
whereClause: {
|
||||
requiresAdminReview: true,
|
||||
},
|
||||
styles: {
|
||||
filter: 'border-yellow-500 bg-yellow-500/20 text-yellow-400',
|
||||
badge: 'rounded-sm bg-yellow-500/20 px-2 py-0.5 text-[12px] font-medium text-yellow-500',
|
||||
},
|
||||
},
|
||||
] as const satisfies CommentStatusFilterInfo[]
|
||||
)
|
||||
|
||||
export type CommentStatusFilter = (typeof commentStatusFilters)[number]['value']
|
||||
|
||||
export function getCommentStatusFilterValue(
|
||||
comment: Prisma.CommentGetPayload<{
|
||||
select: {
|
||||
status: true
|
||||
suspicious: true
|
||||
requiresAdminReview: true
|
||||
}
|
||||
}>
|
||||
): CommentStatusFilter {
|
||||
if (comment.requiresAdminReview) return 'needs-review'
|
||||
if (comment.suspicious) return 'suspicious'
|
||||
|
||||
switch (comment.status) {
|
||||
case 'PENDING':
|
||||
case 'HUMAN_PENDING': {
|
||||
return 'pending'
|
||||
}
|
||||
case 'VERIFIED': {
|
||||
return 'verified'
|
||||
}
|
||||
case 'REJECTED': {
|
||||
return 'rejected'
|
||||
}
|
||||
case 'APPROVED': {
|
||||
return 'approved'
|
||||
}
|
||||
default: {
|
||||
return 'all'
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,61 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
import type { Currency } from '@prisma/client'
|
||||
|
||||
type CurrencyInfo<T extends string | null | undefined = string> = {
|
||||
id: T
|
||||
icon: string
|
||||
name: string
|
||||
slug: string
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: currencies,
|
||||
dataObject: currenciesById,
|
||||
getFn: getCurrencyInfo,
|
||||
getFnSlug: getCurrencyInfoBySlug,
|
||||
zodEnumBySlug: currenciesZodEnumBySlug,
|
||||
keyToSlug: currencyIdToSlug,
|
||||
slugToKey: currencySlugToId,
|
||||
} = makeHelpersForOptions(
|
||||
'id',
|
||||
(id): CurrencyInfo<typeof id> => ({
|
||||
id,
|
||||
icon: 'ri:question-line',
|
||||
name: id ? transformCase(id, 'title') : String(id),
|
||||
slug: id ? id.toLowerCase() : '',
|
||||
}),
|
||||
[
|
||||
{
|
||||
id: 'MONERO',
|
||||
icon: 'monero',
|
||||
name: 'Monero',
|
||||
slug: 'xmr',
|
||||
},
|
||||
{
|
||||
id: 'BITCOIN',
|
||||
icon: 'bitcoin',
|
||||
name: 'Bitcoin',
|
||||
slug: 'btc',
|
||||
},
|
||||
{
|
||||
id: 'LIGHTNING',
|
||||
icon: 'ri:flashlight-line',
|
||||
name: 'Lightning',
|
||||
slug: 'btc-ln',
|
||||
},
|
||||
{
|
||||
id: 'FIAT',
|
||||
icon: 'credit-card',
|
||||
name: 'Fiat',
|
||||
slug: 'fiat',
|
||||
},
|
||||
{
|
||||
id: 'CASH',
|
||||
icon: 'coins',
|
||||
name: 'Cash',
|
||||
slug: 'cash',
|
||||
},
|
||||
] as const satisfies CurrencyInfo<Currency>[]
|
||||
)
|
||||
@@ -1,108 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
import type { EventType } from '@prisma/client'
|
||||
|
||||
type EventTypeInfo<T extends string | null | undefined = string> = {
|
||||
id: T
|
||||
slug: string
|
||||
label: string
|
||||
description: string
|
||||
classNames: {
|
||||
dot: string
|
||||
}
|
||||
icon: string
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: eventTypes,
|
||||
dataObject: eventTypesById,
|
||||
getFn: getEventTypeInfo,
|
||||
getFnSlug: getEventTypeInfoBySlug,
|
||||
zodEnumBySlug: eventTypesZodEnumBySlug,
|
||||
zodEnumById: eventTypesZodEnumById,
|
||||
} = makeHelpersForOptions(
|
||||
'id',
|
||||
(id): EventTypeInfo<typeof id> => ({
|
||||
id,
|
||||
slug: id ? id.toLowerCase() : '',
|
||||
label: id ? transformCase(id, 'title') : String(id),
|
||||
description: '',
|
||||
classNames: {
|
||||
dot: 'bg-zinc-700 text-zinc-300 ring-zinc-700/50',
|
||||
},
|
||||
icon: 'ri:question-fill',
|
||||
}),
|
||||
[
|
||||
{
|
||||
id: 'WARNING',
|
||||
slug: 'warning',
|
||||
label: 'Warning',
|
||||
description: 'Potential issues that users should be aware of',
|
||||
classNames: {
|
||||
dot: 'bg-amber-900 text-amber-300 ring-amber-900/50',
|
||||
},
|
||||
icon: 'ri:error-warning-fill',
|
||||
},
|
||||
{
|
||||
id: 'WARNING_SOLVED',
|
||||
slug: 'warning-solved',
|
||||
label: 'Warning Solved',
|
||||
description: 'A previously reported warning has been solved',
|
||||
classNames: {
|
||||
dot: 'bg-green-900 text-green-300 ring-green-900/50',
|
||||
},
|
||||
icon: 'ri:check-fill',
|
||||
},
|
||||
{
|
||||
id: 'ALERT',
|
||||
slug: 'alert',
|
||||
label: 'Alert',
|
||||
description: 'Critical issues affecting service functionality',
|
||||
classNames: {
|
||||
dot: 'bg-red-900 text-red-300 ring-red-900/50',
|
||||
},
|
||||
icon: 'ri:alert-fill',
|
||||
},
|
||||
{
|
||||
id: 'ALERT_SOLVED',
|
||||
slug: 'alert-solved',
|
||||
label: 'Alert Solved',
|
||||
description: 'A previously reported alert has been solved',
|
||||
classNames: {
|
||||
dot: 'bg-green-900 text-green-300 ring-green-900/50',
|
||||
},
|
||||
icon: 'ri:check-fill',
|
||||
},
|
||||
{
|
||||
id: 'INFO',
|
||||
slug: 'info',
|
||||
label: 'Information',
|
||||
description: 'General information about the service',
|
||||
classNames: {
|
||||
dot: 'bg-blue-900 text-blue-300 ring-blue-900/50',
|
||||
},
|
||||
icon: 'ri:information-fill',
|
||||
},
|
||||
{
|
||||
id: 'NORMAL',
|
||||
slug: 'normal',
|
||||
label: 'Normal',
|
||||
description: 'Regular service update or announcement',
|
||||
classNames: {
|
||||
dot: 'bg-zinc-700 text-zinc-300 ring-zinc-700/50',
|
||||
},
|
||||
icon: 'ri:notification-fill',
|
||||
},
|
||||
{
|
||||
id: 'UPDATE',
|
||||
slug: 'update',
|
||||
label: 'Update',
|
||||
description: 'Service details were updated on kycnot.me',
|
||||
classNames: {
|
||||
dot: 'bg-sky-900 text-sky-300 ring-sky-900/50',
|
||||
},
|
||||
icon: 'ri:pencil-fill',
|
||||
},
|
||||
] as const satisfies EventTypeInfo<EventType>[]
|
||||
)
|
||||
@@ -1,89 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
export type KarmaUnlockInfo<T extends string | null | undefined = string> = {
|
||||
id: T
|
||||
name: string
|
||||
verb: string
|
||||
description: string
|
||||
karma: number
|
||||
icon: string
|
||||
}
|
||||
|
||||
export const { dataArray: karmaUnlocks, dataObject: karmaUnlocksById } = makeHelpersForOptions(
|
||||
'id',
|
||||
(id): KarmaUnlockInfo<typeof id> => ({
|
||||
id,
|
||||
name: id ? transformCase(id, 'title') : String(id),
|
||||
description: id ? transformCase(id, 'sentence') : String(id),
|
||||
karma: 0,
|
||||
icon: 'ri:question-line',
|
||||
verb: id ? transformCase(id, 'title') : String(id),
|
||||
}),
|
||||
[
|
||||
{
|
||||
id: 'voteComments',
|
||||
name: 'Vote on comments',
|
||||
verb: 'vote on comments',
|
||||
description: 'You can vote on comments',
|
||||
karma: 20,
|
||||
icon: 'ri:thumb-up-line',
|
||||
},
|
||||
{
|
||||
id: 'websiteLink',
|
||||
name: 'Website link',
|
||||
verb: 'add a website link',
|
||||
description: 'You can add a website link to your profile',
|
||||
karma: 175,
|
||||
icon: 'ri:link',
|
||||
},
|
||||
{
|
||||
id: 'displayName',
|
||||
name: 'Display name',
|
||||
verb: 'have a display name',
|
||||
description: 'You can change your display name',
|
||||
karma: 150,
|
||||
icon: 'ri:user-smile-line',
|
||||
},
|
||||
{
|
||||
id: 'profilePicture',
|
||||
name: 'Profile picture',
|
||||
verb: 'have a profile picture',
|
||||
description: 'You can change your profile picture',
|
||||
karma: 200,
|
||||
icon: 'ri:image-line',
|
||||
},
|
||||
{
|
||||
id: 'highKarmaBadge',
|
||||
name: 'High Karma badge',
|
||||
verb: 'become a high karma user',
|
||||
description: 'You are a high karma user',
|
||||
karma: 500,
|
||||
icon: 'ri:shield-star-line',
|
||||
},
|
||||
{
|
||||
id: 'negativeKarmaBadge',
|
||||
name: 'Negative Karma badge',
|
||||
verb: 'be a suspicious user',
|
||||
description: 'You are a suspicious user',
|
||||
karma: -10,
|
||||
icon: 'ri:error-warning-line',
|
||||
},
|
||||
{
|
||||
id: 'untrustedBadge',
|
||||
name: 'Untrusted badge',
|
||||
verb: 'be an untrusted user',
|
||||
description: 'You are an untrusted user',
|
||||
karma: -30,
|
||||
icon: 'ri:spam-2-line',
|
||||
},
|
||||
{
|
||||
id: 'commentsDisabled',
|
||||
name: 'Comments disabled',
|
||||
verb: 'cannot comment',
|
||||
description: 'You cannot comment',
|
||||
karma: -50,
|
||||
icon: 'ri:forbid-line',
|
||||
},
|
||||
] as const satisfies KarmaUnlockInfo[]
|
||||
)
|
||||
@@ -1,64 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { parseIntWithFallback } from '../lib/numbers'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
type KycLevelInfo<T extends string | null | undefined = string> = {
|
||||
id: T
|
||||
value: number
|
||||
icon: string
|
||||
name: string
|
||||
description: string
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: kycLevels,
|
||||
dataObject: kycLevelsById,
|
||||
getFn: getKycLevelInfo,
|
||||
} = makeHelpersForOptions(
|
||||
'id',
|
||||
(id): KycLevelInfo<typeof id> => ({
|
||||
id,
|
||||
value: parseIntWithFallback(id, 4),
|
||||
icon: 'diamond-question',
|
||||
name: `KYC ${id ? transformCase(id, 'title') : String(id)}`,
|
||||
description: '',
|
||||
}),
|
||||
[
|
||||
{
|
||||
id: '0',
|
||||
value: 0,
|
||||
icon: 'anonymous-mask',
|
||||
name: 'Guaranteed no KYC',
|
||||
description: 'Terms explicitly state KYC will never be requested.',
|
||||
},
|
||||
{
|
||||
id: '1',
|
||||
value: 1,
|
||||
icon: 'diamond-question',
|
||||
name: 'No KYC mention',
|
||||
description: 'No mention of current or future KYC requirements.',
|
||||
},
|
||||
{
|
||||
id: '2',
|
||||
value: 2,
|
||||
icon: 'handcuffs',
|
||||
name: 'KYC on authorities request',
|
||||
description:
|
||||
'No routine KYC, but may cooperate with authorities, block funds or implement future KYC requirements.',
|
||||
},
|
||||
{
|
||||
id: '3',
|
||||
value: 3,
|
||||
icon: 'gun',
|
||||
name: 'Shotgun KYC',
|
||||
description: 'May request KYC and block funds based on automated triggers.',
|
||||
},
|
||||
{
|
||||
id: '4',
|
||||
value: 4,
|
||||
icon: 'fingerprint-detailed',
|
||||
name: 'Mandatory KYC',
|
||||
description: 'Required for key features and can be required arbitrarily at any time.',
|
||||
},
|
||||
] as const satisfies KycLevelInfo<'0' | '1' | '2' | '3' | '4'>[]
|
||||
)
|
||||
@@ -1,38 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
type NetworkInfo<T extends string | null | undefined = string> = {
|
||||
slug: T
|
||||
icon: string
|
||||
name: string
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: networks,
|
||||
dataObject: networksBySlug,
|
||||
getFn: getNetworkInfo,
|
||||
} = makeHelpersForOptions(
|
||||
'slug',
|
||||
(slug): NetworkInfo<typeof slug> => ({
|
||||
slug,
|
||||
icon: 'ri:global-line',
|
||||
name: slug ? transformCase(slug, 'title') : String(slug),
|
||||
}),
|
||||
[
|
||||
{
|
||||
slug: 'clearnet',
|
||||
icon: 'ri:global-line',
|
||||
name: 'Clearnet',
|
||||
},
|
||||
{
|
||||
slug: 'onion',
|
||||
icon: 'onion',
|
||||
name: 'Onion',
|
||||
},
|
||||
{
|
||||
slug: 'i2p',
|
||||
icon: 'i2p',
|
||||
name: 'I2P',
|
||||
},
|
||||
] as const satisfies NetworkInfo[]
|
||||
)
|
||||
@@ -1,70 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
|
||||
import type { NotificationType } from '@prisma/client'
|
||||
|
||||
type NotificationTypeInfo<T extends string | null | undefined = string> = {
|
||||
id: T
|
||||
label: string
|
||||
icon: string
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: notificationTypes,
|
||||
dataObject: notificationTypeLabels,
|
||||
getFn: getNotificationTypeInfo,
|
||||
} = makeHelpersForOptions(
|
||||
'id',
|
||||
(id): NotificationTypeInfo<typeof id> => ({
|
||||
id,
|
||||
label: 'Notification',
|
||||
icon: 'ri:notification-line',
|
||||
}),
|
||||
[
|
||||
{
|
||||
id: 'COMMENT_STATUS_CHANGE',
|
||||
label: 'Comment status changed',
|
||||
icon: 'ri:chat-check-line',
|
||||
},
|
||||
{
|
||||
id: 'REPLY_COMMENT_CREATED',
|
||||
label: 'New reply',
|
||||
icon: 'ri:chat-4-line',
|
||||
},
|
||||
{
|
||||
id: 'ROOT_COMMENT_CREATED',
|
||||
label: 'New comment/rating',
|
||||
icon: 'ri:chat-4-line',
|
||||
},
|
||||
{
|
||||
id: 'SUGGESTION_MESSAGE',
|
||||
label: 'New message in suggestion',
|
||||
icon: 'ri:mail-line',
|
||||
},
|
||||
{
|
||||
id: 'SUGGESTION_STATUS_CHANGE',
|
||||
label: 'Suggestion status changed',
|
||||
icon: 'ri:lightbulb-line',
|
||||
},
|
||||
// TODO: [KARMA_UNLOCK] Will be added later, when karma unloks are in the database, not in the code.
|
||||
// {
|
||||
// id: 'KARMA_UNLOCK',
|
||||
// label: 'Karma unlock',
|
||||
// icon: 'ri:award-line',
|
||||
// },
|
||||
{
|
||||
id: 'ACCOUNT_STATUS_CHANGE',
|
||||
label: 'Change in account status',
|
||||
icon: 'ri:user-settings-line',
|
||||
},
|
||||
{
|
||||
id: 'EVENT_CREATED',
|
||||
label: 'New event',
|
||||
icon: 'ri:calendar-event-line',
|
||||
},
|
||||
{
|
||||
id: 'SERVICE_VERIFICATION_STATUS_CHANGE',
|
||||
label: 'Service verification changed',
|
||||
icon: 'ri:verified-badge-line',
|
||||
},
|
||||
] as const satisfies NotificationTypeInfo<NotificationType>[]
|
||||
)
|
||||
@@ -1 +0,0 @@
|
||||
export const SUPPORT_EMAIL = 'support@kycnot.me'
|
||||
@@ -1,48 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
import type { ServiceVerificationStatusChange } from '@prisma/client'
|
||||
|
||||
type ServiceVerificationStatusChangeInfo<T extends string | null | undefined = string> = {
|
||||
value: T
|
||||
label: string
|
||||
notificationTitle: string
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: serviceVerificationStatusChanges,
|
||||
dataObject: serviceVerificationStatusChangesById,
|
||||
getFn: getServiceVerificationStatusChangeInfo,
|
||||
zodEnumById: serviceVerificationStatusChangesZodEnumById,
|
||||
} = makeHelpersForOptions(
|
||||
'value',
|
||||
(value): ServiceVerificationStatusChangeInfo<typeof value> => ({
|
||||
value,
|
||||
label: value ? transformCase(value.replaceAll('_', ' '), 'title') : String(value),
|
||||
notificationTitle: value ? transformCase(value.replaceAll('_', ' '), 'title') : String(value),
|
||||
}),
|
||||
[
|
||||
{
|
||||
value: 'STATUS_CHANGED_TO_COMMUNITY_CONTRIBUTED',
|
||||
label: 'status changed to community contributed',
|
||||
notificationTitle: 'status changed to community contributed',
|
||||
},
|
||||
{
|
||||
value: 'STATUS_CHANGED_TO_APPROVED',
|
||||
label: 'status changed to approved',
|
||||
notificationTitle: 'status changed to approved',
|
||||
},
|
||||
{
|
||||
value: 'STATUS_CHANGED_TO_VERIFICATION_SUCCESS',
|
||||
label: 'status changed to verification success',
|
||||
notificationTitle: 'status changed to verification success',
|
||||
},
|
||||
{
|
||||
value: 'STATUS_CHANGED_TO_VERIFICATION_FAILED',
|
||||
label: 'status changed to verification failed',
|
||||
notificationTitle: 'status changed to verification failed',
|
||||
},
|
||||
] as const satisfies ServiceVerificationStatusChangeInfo<ServiceVerificationStatusChange>[]
|
||||
)
|
||||
|
||||
export type ServiceVerificationStatusChangeType = (typeof serviceVerificationStatusChanges)[number]['value']
|
||||
@@ -1,68 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
import type { ServiceSuggestionStatus } from '@prisma/client'
|
||||
|
||||
type ServiceSuggestionStatusInfo<T extends string | null | undefined = string> = {
|
||||
value: T
|
||||
slug: string
|
||||
label: string
|
||||
icon: string
|
||||
iconClass: string
|
||||
default: boolean
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: serviceSuggestionStatuses,
|
||||
dataObject: serviceSuggestionStatusesById,
|
||||
getFn: getServiceSuggestionStatusInfo,
|
||||
getFnSlug: getServiceSuggestionStatusInfoBySlug,
|
||||
zodEnumBySlug: serviceSuggestionStatusesZodEnumBySlug,
|
||||
zodEnumById: serviceSuggestionStatusesZodEnumById,
|
||||
keyToSlug: serviceSuggestionStatusIdToSlug,
|
||||
slugToKey: serviceSuggestionStatusSlugToId,
|
||||
} = makeHelpersForOptions(
|
||||
'value',
|
||||
(value): ServiceSuggestionStatusInfo<typeof value> => ({
|
||||
value,
|
||||
slug: value ? value.toLowerCase() : '',
|
||||
label: value ? transformCase(value, 'title') : String(value),
|
||||
icon: 'ri:question-line',
|
||||
iconClass: 'text-current/60',
|
||||
default: false,
|
||||
}),
|
||||
[
|
||||
{
|
||||
value: 'PENDING',
|
||||
slug: 'pending',
|
||||
label: 'Pending',
|
||||
icon: 'ri:time-line',
|
||||
iconClass: 'text-yellow-400',
|
||||
default: true,
|
||||
},
|
||||
{
|
||||
value: 'APPROVED',
|
||||
slug: 'approved',
|
||||
label: 'Approved',
|
||||
icon: 'ri:check-line',
|
||||
iconClass: 'text-green-400',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
value: 'REJECTED',
|
||||
slug: 'rejected',
|
||||
label: 'Rejected',
|
||||
icon: 'ri:close-line',
|
||||
iconClass: 'text-red-400',
|
||||
default: false,
|
||||
},
|
||||
{
|
||||
value: 'WITHDRAWN',
|
||||
slug: 'withdrawn',
|
||||
label: 'Withdrawn',
|
||||
icon: 'ri:arrow-left-line',
|
||||
iconClass: 'text-gray-400',
|
||||
default: false,
|
||||
},
|
||||
] as const satisfies ServiceSuggestionStatusInfo<ServiceSuggestionStatus>[]
|
||||
)
|
||||
@@ -1,48 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
import type { ServiceSuggestionType } from '@prisma/client'
|
||||
|
||||
type ServiceSuggestionTypeInfo<T extends string | null | undefined = string> = {
|
||||
value: T
|
||||
slug: string
|
||||
label: string
|
||||
icon: string
|
||||
default: boolean
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: serviceSuggestionTypes,
|
||||
dataObject: serviceSuggestionTypesById,
|
||||
getFn: getServiceSuggestionTypeInfo,
|
||||
getFnSlug: getServiceSuggestionTypeInfoBySlug,
|
||||
zodEnumBySlug: serviceSuggestionTypesZodEnumBySlug,
|
||||
zodEnumById: serviceSuggestionTypesZodEnumById,
|
||||
keyToSlug: serviceSuggestionTypeIdToSlug,
|
||||
slugToKey: serviceSuggestionTypeSlugToId,
|
||||
} = makeHelpersForOptions(
|
||||
'value',
|
||||
(value): ServiceSuggestionTypeInfo<typeof value> => ({
|
||||
value,
|
||||
slug: value ? value.toLowerCase() : '',
|
||||
label: value ? transformCase(value, 'title') : String(value),
|
||||
icon: 'ri:question-line',
|
||||
default: false,
|
||||
}),
|
||||
[
|
||||
{
|
||||
value: 'CREATE_SERVICE',
|
||||
slug: 'create',
|
||||
label: 'Create',
|
||||
icon: 'ri:add-line',
|
||||
default: true,
|
||||
},
|
||||
{
|
||||
value: 'EDIT_SERVICE',
|
||||
slug: 'edit',
|
||||
label: 'Edit',
|
||||
icon: 'ri:pencil-line',
|
||||
default: false,
|
||||
},
|
||||
] as const satisfies ServiceSuggestionTypeInfo<ServiceSuggestionType>[]
|
||||
)
|
||||
@@ -1,73 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
import type BadgeSmall from '../components/BadgeSmall.astro'
|
||||
import type { ServiceUserRole } from '@prisma/client'
|
||||
import type { ComponentProps } from 'astro/types'
|
||||
|
||||
type ServiceUserRoleInfo<T extends string | null | undefined = string> = {
|
||||
value: T
|
||||
slug: string
|
||||
label: string
|
||||
icon: string
|
||||
order: number
|
||||
color: NonNullable<ComponentProps<typeof BadgeSmall>['color']>
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: serviceUserRoles,
|
||||
dataObject: serviceUserRolesById,
|
||||
getFn: getServiceUserRoleInfo,
|
||||
} = makeHelpersForOptions(
|
||||
'value',
|
||||
(value): ServiceUserRoleInfo<typeof value> => ({
|
||||
value,
|
||||
slug: value ? value.toLowerCase() : '',
|
||||
label: value ? transformCase(value, 'title').replace('_', ' ') : String(value),
|
||||
icon: 'ri:user-3-line',
|
||||
order: Infinity,
|
||||
color: 'gray',
|
||||
}),
|
||||
[
|
||||
{
|
||||
value: 'OWNER',
|
||||
slug: 'owner',
|
||||
label: 'Owner',
|
||||
icon: 'ri:vip-crown-2-fill',
|
||||
order: 1,
|
||||
color: 'lime',
|
||||
},
|
||||
{
|
||||
value: 'ADMIN',
|
||||
slug: 'admin',
|
||||
label: 'Admin',
|
||||
icon: 'ri:shield-star-fill',
|
||||
order: 2,
|
||||
color: 'green',
|
||||
},
|
||||
{
|
||||
value: 'MODERATOR',
|
||||
slug: 'moderator',
|
||||
label: 'Moderator',
|
||||
icon: 'ri:glasses-2-line',
|
||||
order: 3,
|
||||
color: 'teal',
|
||||
},
|
||||
{
|
||||
value: 'SUPPORT',
|
||||
slug: 'support',
|
||||
label: 'Support',
|
||||
icon: 'ri:customer-service-2-fill',
|
||||
order: 4,
|
||||
color: 'blue',
|
||||
},
|
||||
{
|
||||
value: 'TEAM_MEMBER',
|
||||
slug: 'team_member',
|
||||
label: 'Team Member',
|
||||
icon: 'ri:team-fill',
|
||||
order: 5,
|
||||
color: 'cyan',
|
||||
},
|
||||
] as const satisfies ServiceUserRoleInfo<ServiceUserRole>[]
|
||||
)
|
||||
@@ -1,60 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
import type { ServiceVisibility } from '@prisma/client'
|
||||
|
||||
type ServiceVisibilityInfo<T extends string | null | undefined = string> = {
|
||||
value: T
|
||||
slug: string
|
||||
label: string
|
||||
description: string
|
||||
icon: string
|
||||
iconClass: string
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: serviceVisibilities,
|
||||
dataObject: serviceVisibilitiesById,
|
||||
getFn: getServiceVisibilityInfo,
|
||||
getFnSlug: getServiceVisibilityInfoBySlug,
|
||||
zodEnumBySlug: serviceVisibilitiesZodEnumBySlug,
|
||||
zodEnumById: serviceVisibilitiesZodEnumById,
|
||||
keyToSlug: serviceVisibilityIdToSlug,
|
||||
slugToKey: serviceVisibilitySlugToId,
|
||||
} = makeHelpersForOptions(
|
||||
'value',
|
||||
(value): ServiceVisibilityInfo<typeof value> => ({
|
||||
value,
|
||||
slug: value ? value.toLowerCase() : '',
|
||||
label: value ? transformCase(value, 'title') : String(value),
|
||||
description: '',
|
||||
icon: 'ri:eye-line',
|
||||
iconClass: 'text-current/60',
|
||||
}),
|
||||
[
|
||||
{
|
||||
value: 'PUBLIC',
|
||||
slug: 'public',
|
||||
label: 'Public',
|
||||
description: 'Listed in search and browse.',
|
||||
icon: 'ri:global-line',
|
||||
iconClass: 'text-green-500',
|
||||
},
|
||||
{
|
||||
value: 'UNLISTED',
|
||||
slug: 'unlisted',
|
||||
label: 'Unlisted',
|
||||
description: 'Only accessible via direct link.',
|
||||
icon: 'ri:link',
|
||||
iconClass: 'text-yellow-500',
|
||||
},
|
||||
{
|
||||
value: 'HIDDEN',
|
||||
slug: 'hidden',
|
||||
label: 'Hidden',
|
||||
description: 'Only visible to moderators.',
|
||||
icon: 'ri:lock-line',
|
||||
iconClass: 'text-red-500',
|
||||
},
|
||||
] as const satisfies ServiceVisibilityInfo<ServiceVisibility>[]
|
||||
)
|
||||
@@ -1,17 +0,0 @@
|
||||
export const splashTexts: string[] = [
|
||||
'Privacy is not a crime.',
|
||||
'True financial independence.',
|
||||
'Privacy is a human right.',
|
||||
'Cypherpunk zone ahead.',
|
||||
'KYC? Not me!',
|
||||
'Freedom through privacy.',
|
||||
'Resist surveillance.',
|
||||
'Anonymity is power.',
|
||||
'Defend your privacy.',
|
||||
'Unbank yourself.',
|
||||
'Banking without borders.',
|
||||
'Escape the panopticon.',
|
||||
'Ditch the gatekeepers.',
|
||||
'Own your identity.',
|
||||
'Financial privacy matters.',
|
||||
]
|
||||
@@ -1,48 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
import type { ServiceSuggestionStatusChange } from '@prisma/client'
|
||||
|
||||
type ServiceSuggestionStatusChangeInfo<T extends string | null | undefined = string> = {
|
||||
value: T
|
||||
label: string
|
||||
notificationTitle: string
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: serviceSuggestionStatusChanges,
|
||||
dataObject: serviceSuggestionStatusChangesById,
|
||||
getFn: getServiceSuggestionStatusChangeInfo,
|
||||
zodEnumById: serviceSuggestionStatusChangesZodEnumById,
|
||||
} = makeHelpersForOptions(
|
||||
'value',
|
||||
(value): ServiceSuggestionStatusChangeInfo<typeof value> => ({
|
||||
value,
|
||||
label: value ? transformCase(value.replaceAll('_', ' '), 'title') : String(value),
|
||||
notificationTitle: value ? transformCase(value.replaceAll('_', ' '), 'title') : String(value),
|
||||
}),
|
||||
[
|
||||
{
|
||||
value: 'STATUS_CHANGED_TO_PENDING',
|
||||
label: 'status changed to pending',
|
||||
notificationTitle: 'status changed to pending',
|
||||
},
|
||||
{
|
||||
value: 'STATUS_CHANGED_TO_APPROVED',
|
||||
label: 'status changed to approved',
|
||||
notificationTitle: 'status changed to approved',
|
||||
},
|
||||
{
|
||||
value: 'STATUS_CHANGED_TO_REJECTED',
|
||||
label: 'status changed to rejected',
|
||||
notificationTitle: 'status changed to rejected',
|
||||
},
|
||||
{
|
||||
value: 'STATUS_CHANGED_TO_WITHDRAWN',
|
||||
label: 'status changed to withdrawn',
|
||||
notificationTitle: 'status changed to withdrawn',
|
||||
},
|
||||
] as const satisfies ServiceSuggestionStatusChangeInfo<ServiceSuggestionStatusChange>[]
|
||||
)
|
||||
|
||||
export type ServiceSuggestionStatusChangeType = (typeof serviceSuggestionStatusChanges)[number]['value']
|
||||
@@ -1,63 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
type TosHighlightRatingInfo<T extends string | null | undefined = string> = {
|
||||
id: T
|
||||
icon: string
|
||||
name: string
|
||||
classNames: {
|
||||
icon: string
|
||||
borderColor: string
|
||||
}
|
||||
order: number
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: tosHighlightRatings,
|
||||
dataObject: tosHighlightRatingsById,
|
||||
getFn: getTosHighlightRatingInfo,
|
||||
} = makeHelpersForOptions(
|
||||
'id',
|
||||
(id): TosHighlightRatingInfo<typeof id> => ({
|
||||
id,
|
||||
icon: 'ri:question-line',
|
||||
name: id ? transformCase(id, 'title') : String(id),
|
||||
classNames: {
|
||||
icon: 'text-yellow-400',
|
||||
borderColor: 'border-yellow-500/40',
|
||||
},
|
||||
order: Infinity,
|
||||
}),
|
||||
[
|
||||
{
|
||||
id: 'negative',
|
||||
icon: 'ri:thumb-down-line',
|
||||
name: 'Negative',
|
||||
classNames: {
|
||||
icon: 'text-red-400',
|
||||
borderColor: 'border-red-500/40',
|
||||
},
|
||||
order: 1,
|
||||
},
|
||||
{
|
||||
id: 'positive',
|
||||
icon: 'ri:thumb-up-line',
|
||||
name: 'Positive',
|
||||
classNames: {
|
||||
icon: 'text-green-400',
|
||||
borderColor: 'border-green-500/40',
|
||||
},
|
||||
order: 2,
|
||||
},
|
||||
{
|
||||
id: 'neutral',
|
||||
icon: 'ri:information-line',
|
||||
name: 'Neutral',
|
||||
classNames: {
|
||||
icon: 'text-blue-400',
|
||||
borderColor: 'border-blue-500/40',
|
||||
},
|
||||
order: 3,
|
||||
},
|
||||
] as const satisfies TosHighlightRatingInfo[]
|
||||
)
|
||||
@@ -1,63 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
type UserSentimentInfo<T extends string | null | undefined = string> = {
|
||||
id: T
|
||||
icon: string
|
||||
name: string
|
||||
classNames: {
|
||||
icon: string
|
||||
borderColor: string
|
||||
background: string
|
||||
}
|
||||
}
|
||||
|
||||
export const {
|
||||
dataArray: userSentiments,
|
||||
dataObject: userSentimentsById,
|
||||
getFn: getUserSentimentInfo,
|
||||
} = makeHelpersForOptions(
|
||||
'id',
|
||||
(id): UserSentimentInfo<typeof id> => ({
|
||||
id,
|
||||
icon: 'ri:emotion-normal-line',
|
||||
name: id ? transformCase(id, 'title') : String(id),
|
||||
classNames: {
|
||||
icon: 'text-yellow-400',
|
||||
borderColor: 'border-yellow-500/40',
|
||||
background: 'bg-yellow-950/20',
|
||||
},
|
||||
}),
|
||||
[
|
||||
{
|
||||
id: 'positive',
|
||||
icon: 'ri:emotion-happy-line',
|
||||
name: 'Positive',
|
||||
classNames: {
|
||||
icon: 'text-green-400',
|
||||
borderColor: 'border-green-500/40',
|
||||
background: 'bg-green-950/20',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'neutral',
|
||||
icon: 'ri:emotion-normal-line',
|
||||
name: 'Neutral',
|
||||
classNames: {
|
||||
icon: 'text-blue-400',
|
||||
borderColor: 'border-blue-500/40',
|
||||
background: 'bg-blue-950/20',
|
||||
},
|
||||
},
|
||||
{
|
||||
id: 'negative',
|
||||
icon: 'ri:emotion-unhappy-line',
|
||||
name: 'Negative',
|
||||
classNames: {
|
||||
icon: 'text-red-400',
|
||||
borderColor: 'border-red-500/40',
|
||||
background: 'bg-red-950/20',
|
||||
},
|
||||
},
|
||||
] as const satisfies UserSentimentInfo[]
|
||||
)
|
||||
@@ -1,146 +0,0 @@
|
||||
import { makeHelpersForOptions } from '../lib/makeHelpersForOptions'
|
||||
import { transformCase } from '../lib/strings'
|
||||
|
||||
import type { MarkdownString } from '../lib/markdown'
|
||||
import type { VerificationStatus } from '@prisma/client'
|
||||
|
||||
type VerificationStatusInfo<T extends string | null | undefined = string> = {
|
||||
value: T
|
||||
slug: string
|
||||
labelShort: string
|
||||
label: string
|
||||
icon: string
|
||||
default: boolean
|
||||
description: string
|
||||
privacyPoints: number
|
||||
trustPoints: number
|
||||
classNames: {
|
||||
icon: string
|
||||
badgeBig: string
|
||||
button: string
|
||||
description: string
|
||||
containerBg: string
|
||||
}
|
||||
order: number
|
||||
verbPast: string
|
||||
}
|
||||
|
||||
export const READ_MORE_SENTENCE_LINK =
|
||||
'Read more about the [suggestion review process](/about#suggestion-review-process).' satisfies MarkdownString
|
||||
|
||||
export const {
|
||||
dataArray: verificationStatuses,
|
||||
dataObject: verificationStatusesByValue,
|
||||
getFn: getVerificationStatusInfo,
|
||||
getFnSlug: getVerificationStatusInfoBySlug,
|
||||
zodEnumBySlug: verificationStatusesZodEnumBySlug,
|
||||
zodEnumById: verificationStatusesZodEnumById,
|
||||
keyToSlug: verificationStatusIdToSlug,
|
||||
slugToKey: verificationStatusSlugToId,
|
||||
} = makeHelpersForOptions(
|
||||
'value',
|
||||
(value): VerificationStatusInfo<typeof value> => ({
|
||||
value,
|
||||
slug: value ? value.toLowerCase() : '',
|
||||
labelShort: value ? transformCase(value, 'title') : String(value),
|
||||
label: value ? transformCase(value, 'title') : String(value),
|
||||
icon: 'ri:loader-line',
|
||||
default: false,
|
||||
description: '',
|
||||
privacyPoints: 0,
|
||||
trustPoints: 0,
|
||||
classNames: {
|
||||
icon: 'text-current',
|
||||
badgeBig: 'bg-night-400 text-day-100',
|
||||
button: 'bg-night-400 hover:bg-night-300',
|
||||
description: 'text-day-200',
|
||||
containerBg: 'bg-night-600',
|
||||
},
|
||||
order: Infinity,
|
||||
verbPast: value ? transformCase(value, 'title') : String(value),
|
||||
}),
|
||||
[
|
||||
{
|
||||
value: 'VERIFICATION_SUCCESS',
|
||||
slug: 'verified',
|
||||
labelShort: 'Verified',
|
||||
label: 'Verified',
|
||||
icon: 'ri:verified-badge-fill',
|
||||
default: true,
|
||||
description:
|
||||
'Thoroughly tested and verified by the team. But things might change, this is not a guarantee.',
|
||||
privacyPoints: 0,
|
||||
trustPoints: 5,
|
||||
classNames: {
|
||||
icon: 'text-[#40e6c2]',
|
||||
badgeBig: 'bg-green-800/50 text-green-100',
|
||||
button: 'bg-green-700 hover:bg-green-600',
|
||||
description: 'text-green-200',
|
||||
containerBg: 'bg-green-900/30',
|
||||
},
|
||||
order: 1,
|
||||
verbPast: 'verified',
|
||||
},
|
||||
{
|
||||
value: 'APPROVED',
|
||||
slug: 'approved',
|
||||
labelShort: 'Approved',
|
||||
label: 'Approved',
|
||||
icon: 'ri:check-line',
|
||||
default: true,
|
||||
description:
|
||||
'Everything checks out at first glance, but not verified nor thoroughly tested by the team.',
|
||||
privacyPoints: 0,
|
||||
trustPoints: 5,
|
||||
classNames: {
|
||||
icon: 'text-white',
|
||||
badgeBig: 'bg-night-400 text-day-100',
|
||||
button: 'bg-night-400 hover:bg-night-300',
|
||||
description: 'text-day-200',
|
||||
containerBg: 'bg-night-600',
|
||||
},
|
||||
order: 2,
|
||||
verbPast: 'approved',
|
||||
},
|
||||
{
|
||||
value: 'COMMUNITY_CONTRIBUTED',
|
||||
slug: 'community',
|
||||
labelShort: 'Community',
|
||||
label: 'Community Contributed',
|
||||
icon: 'ri:question-line',
|
||||
default: false,
|
||||
description: 'Suggested by the community, but not reviewed by the team yet.',
|
||||
privacyPoints: 0,
|
||||
trustPoints: 0,
|
||||
classNames: {
|
||||
icon: 'text-yellow-400',
|
||||
badgeBig: 'bg-amber-800/50 text-amber-100',
|
||||
button: 'bg-amber-700 hover:bg-amber-600',
|
||||
description: 'text-amber-200',
|
||||
containerBg: 'bg-amber-900/30',
|
||||
},
|
||||
order: 3,
|
||||
verbPast: 'contributed by the community',
|
||||
},
|
||||
{
|
||||
value: 'VERIFICATION_FAILED',
|
||||
slug: 'scam',
|
||||
labelShort: 'Scam',
|
||||
label: 'Scam',
|
||||
icon: 'ri:alert-fill',
|
||||
default: false,
|
||||
description: 'Confirmed as a SCAM or not what it claims to be.',
|
||||
privacyPoints: 0,
|
||||
trustPoints: -30,
|
||||
classNames: {
|
||||
icon: 'text-red-500',
|
||||
badgeBig: 'bg-red-800/50 text-red-100',
|
||||
button: 'bg-red-700 hover:bg-red-600',
|
||||
description: 'text-red-200',
|
||||
containerBg: 'bg-red-900/30',
|
||||
},
|
||||
order: 4,
|
||||
verbPast: 'marked as a SCAM',
|
||||
},
|
||||
] as const satisfies VerificationStatusInfo<VerificationStatus>[]
|
||||
)
|
||||
Reference in New Issue
Block a user