--- import { Icon } from 'astro-icon/components' import { actions } from 'astro:actions' import { cn } from '../lib/cn' import { makeLoginUrl } from '../lib/redirectUrls' import Button from './Button.astro' import FormTimeTrap from './FormTimeTrap.astro' import InputHoneypotTrap from './InputHoneypotTrap.astro' import InputRating from './InputRating.astro' import InputText from './InputText.astro' import InputWrapper from './InputWrapper.astro' import UserBadge from './UserBadge.astro' import type { Prisma } from '@prisma/client' import type { HTMLAttributes } from 'astro/types' type Props = Omit, 'action' | 'enctype' | 'method'> & { serviceId: number parentId?: number commentId?: number activeRatingComment?: Prisma.CommentGetPayload<{ select: { id: true rating: true } }> | null } const { serviceId, parentId, commentId, activeRatingComment, class: className, ...htmlProps } = Astro.props const MIN_COMMENT_LENGTH = parentId ? 10 : 30 const user = Astro.locals.user const userCommentsDisabled = user ? user.karmaUnlocks.commentsDisabled : false ---
{parentId && }
{ user ? ( userCommentsDisabled ? (
You cannot comment due to low karma.
) : ( <>
Commenting as: