Skip to content

Commit

Permalink
Merge pull request #1031 from hackclub/ai_feedback
Browse files Browse the repository at this point in the history
Added feedback
  • Loading branch information
polytroper authored Dec 23, 2024
2 parents 32c0d89 + d5985cf commit 11bd1f6
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 0 deletions.
24 changes: 24 additions & 0 deletions src/app/harbor/shipyard/ships.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ export default function Ships({
)
const [updateChainExpanded, setUpdateChainExpanded] = useState(false)
const [readmeText, setReadmeText] = useState<string | null>(null)
const [feedbackText, setFeedbackText] = useState<string | null>(null)
const [newShipVisible, setNewShipVisible] = useState(false)
const [newUpdateShip, setNewUpdateShip] = useState<Ship | null>(null)
const [session, setSession] = useState<HsSession | null>(null)
Expand Down Expand Up @@ -649,6 +650,29 @@ export default function Ships({
height={11}
/>

{selectedShip?.feedback && (
<>
<Card className="p-4 m-5">
<h5 className="text-xl font-bold mb-2">Feedback</h5>
<p className="text-base whitespace-pre-line">
{selectedShip.feedback}
</p>
<p className="text-xs text-gray-500 mt-3 italic">
This summary is auto-generated from the votes on this
project and may contain occasional errors.
</p>
</Card>

<Image
src="/hr.svg"
className="w-2/3 mx-auto my-3"
alt=""
width={461}
height={11}
/>
</>
)}

{readmeText ? (
<div className="prose max-w-none">
{readmeText === '?' ? (
Expand Down
2 changes: 2 additions & 0 deletions src/app/utils/data.ts
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ export interface Ship extends EditableShipFields {
reshippedFromAll: string[] | null
paidOut: boolean
yswsType: YswsType
feedback: string | null
}
export interface EditableShipFields {
title: string
Expand Down Expand Up @@ -142,6 +143,7 @@ export async function fetchShips(
reshippedFromAll,
paidOut: Boolean(r.fields.paid_out),
yswsType: r.fields.yswsType,
feedback: r.fields.ai_feedback_summary,
}

return ship
Expand Down

0 comments on commit 11bd1f6

Please sign in to comment.