-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
6adbb44
commit 2e82891
Showing
3 changed files
with
73 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,61 @@ | ||
import { Group, Stack } from "@mantine/core"; | ||
import StandardCardTitle from "@/app/components/StandardCardTitle"; | ||
import moment from "moment"; | ||
import StandardCardDescription from "@/app/components/StandardCardDescription"; | ||
import Markdown from "react-markdown"; | ||
import SummaryAiDisclaimer from "@/app/components/SummaryAiDisclaimer"; | ||
import SummaryNotAvailableApology from "@/app/components/SummaryNotAvailableApology"; | ||
import StandardButton from "@/app/components/StandardButton"; | ||
import StandardCard from "@/app/components/StandardCard"; | ||
|
||
export default function ShortDebate({ | ||
debate, | ||
}: { | ||
debate: { | ||
id: number; | ||
title: string; | ||
summary: string | null; | ||
sitting: { | ||
sitting_date: { | ||
sitting_date: string; | ||
} | null; | ||
} | null; | ||
}; | ||
}) { | ||
return ( | ||
<StandardCard> | ||
<Group justify="space-between"> | ||
<StandardCardTitle>{debate.title}</StandardCardTitle> | ||
</Group> | ||
|
||
<StandardCardDescription> | ||
{moment(debate.sitting!.sitting_date!.sitting_date).format( | ||
"D MMM YYYY", | ||
)} | ||
</StandardCardDescription> | ||
|
||
<StandardCardDescription> | ||
{debate.summary ? ( | ||
<Stack> | ||
<Markdown>{debate.summary}</Markdown> | ||
<SummaryAiDisclaimer /> | ||
</Stack> | ||
) : ( | ||
<SummaryNotAvailableApology /> | ||
)} | ||
</StandardCardDescription> | ||
|
||
<Group grow mt="md"> | ||
<StandardButton colour="blue" href={`/debates/${debate.id}`}> | ||
Overview | ||
</StandardButton> | ||
<StandardButton | ||
colour="gray" | ||
href={`https://sprs.parl.gov.sg/search/#/fullreport?sittingdate=${moment(debate.sitting!.sitting_date!.sitting_date).format("DD-MM-YYYY")}`} | ||
> | ||
Original source | ||
</StandardButton> | ||
</Group> | ||
</StandardCard> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters