|
|
@ -1,4 +1,5 @@
|
|
|
|
import clsx from 'clsx';
|
|
|
|
import clsx from 'clsx';
|
|
|
|
|
|
|
|
import { formatDistanceToNow } from 'date-fns';
|
|
|
|
import { useState } from 'react';
|
|
|
|
import { useState } from 'react';
|
|
|
|
import { ChevronUpIcon } from '@heroicons/react/20/solid';
|
|
|
|
import { ChevronUpIcon } from '@heroicons/react/20/solid';
|
|
|
|
import { FaceSmileIcon } from '@heroicons/react/24/outline';
|
|
|
|
import { FaceSmileIcon } from '@heroicons/react/24/outline';
|
|
|
@ -26,12 +27,7 @@ export default function ResumeCommentListItem({
|
|
|
|
const [showReplies, setShowReplies] = useState(true);
|
|
|
|
const [showReplies, setShowReplies] = useState(true);
|
|
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<div
|
|
|
|
<div className="min-w-fit">
|
|
|
|
className={clsx(
|
|
|
|
|
|
|
|
'min-w-fit rounded-md bg-white ',
|
|
|
|
|
|
|
|
!comment.parentId &&
|
|
|
|
|
|
|
|
'border-primary-300 w-11/12 border-2 p-2 drop-shadow-md',
|
|
|
|
|
|
|
|
)}>
|
|
|
|
|
|
|
|
<div className="flex flex-row space-x-2 p-1 align-top">
|
|
|
|
<div className="flex flex-row space-x-2 p-1 align-top">
|
|
|
|
{/* Image Icon */}
|
|
|
|
{/* Image Icon */}
|
|
|
|
{comment.user.image ? (
|
|
|
|
{comment.user.image ? (
|
|
|
@ -58,7 +54,7 @@ export default function ResumeCommentListItem({
|
|
|
|
<div className="flex flex-row items-center space-x-1">
|
|
|
|
<div className="flex flex-row items-center space-x-1">
|
|
|
|
<p
|
|
|
|
<p
|
|
|
|
className={clsx(
|
|
|
|
className={clsx(
|
|
|
|
'font-medium text-black',
|
|
|
|
'font-medium text-gray-800',
|
|
|
|
!!comment.parentId && 'text-sm',
|
|
|
|
!!comment.parentId && 'text-sm',
|
|
|
|
)}>
|
|
|
|
)}>
|
|
|
|
{comment.user.name ?? 'Reviewer ABC'}
|
|
|
|
{comment.user.name ?? 'Reviewer ABC'}
|
|
|
@ -72,9 +68,8 @@ export default function ResumeCommentListItem({
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="px-2 text-xs text-slate-600">
|
|
|
|
<div className="px-2 text-xs text-slate-600">
|
|
|
|
{comment.createdAt.toLocaleString('en-US', {
|
|
|
|
{formatDistanceToNow(comment.createdAt, {
|
|
|
|
dateStyle: 'medium',
|
|
|
|
addSuffix: true,
|
|
|
|
timeStyle: 'short',
|
|
|
|
|
|
|
|
})}
|
|
|
|
})}
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
@ -86,10 +81,12 @@ export default function ResumeCommentListItem({
|
|
|
|
setIsEditingComment={setIsEditingComment}
|
|
|
|
setIsEditingComment={setIsEditingComment}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
) : (
|
|
|
|
) : (
|
|
|
|
<ResumeExpandableText
|
|
|
|
<div className="text-gray-800">
|
|
|
|
key={comment.description}
|
|
|
|
<ResumeExpandableText
|
|
|
|
text={comment.description}
|
|
|
|
key={comment.description}
|
|
|
|
/>
|
|
|
|
text={comment.description}
|
|
|
|
|
|
|
|
/>
|
|
|
|
|
|
|
|
</div>
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
|
|
|
|
|
|
|
|
{/* Upvote and edit */}
|
|
|
|
{/* Upvote and edit */}
|
|
|
@ -143,7 +140,15 @@ export default function ResumeCommentListItem({
|
|
|
|
!showReplies && 'rotate-180 transform',
|
|
|
|
!showReplies && 'rotate-180 transform',
|
|
|
|
)}
|
|
|
|
)}
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
<span>{showReplies ? 'Hide replies' : 'Show replies'}</span>
|
|
|
|
<span>
|
|
|
|
|
|
|
|
{showReplies
|
|
|
|
|
|
|
|
? `Hide ${
|
|
|
|
|
|
|
|
comment.children.length === 1 ? 'reply' : 'replies'
|
|
|
|
|
|
|
|
}`
|
|
|
|
|
|
|
|
: `Show ${comment.children.length} ${
|
|
|
|
|
|
|
|
comment.children.length === 1 ? 'reply' : 'replies'
|
|
|
|
|
|
|
|
}`}
|
|
|
|
|
|
|
|
</span>
|
|
|
|
</button>
|
|
|
|
</button>
|
|
|
|
|
|
|
|
|
|
|
|
{showReplies && (
|
|
|
|
{showReplies && (
|
|
|
@ -152,7 +157,7 @@ export default function ResumeCommentListItem({
|
|
|
|
<div className="flex-grow border-r border-slate-300" />
|
|
|
|
<div className="flex-grow border-r border-slate-300" />
|
|
|
|
</div>
|
|
|
|
</div>
|
|
|
|
|
|
|
|
|
|
|
|
<div className="flex flex-col space-y-1">
|
|
|
|
<div className="flex flex-1 flex-col space-y-1">
|
|
|
|
{comment.children.map((child) => {
|
|
|
|
{comment.children.map((child) => {
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<ResumeCommentListItem
|
|
|
|
<ResumeCommentListItem
|
|
|
|