Skip to content

Commit 7bc8fc0

Browse files
committed
feat: display readme as summary when ai summary is unavailable
1 parent 689f433 commit 7bc8fc0

File tree

1 file changed

+25
-1
lines changed

1 file changed

+25
-1
lines changed

src/pages/UpdatedDatasetDetailPage.tsx

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ const UpdatedDatasetDetailPage: React.FC = () => {
9393
const [copiedKey, setCopiedKey] = useState<string | null>(null);
9494
const copyTimer = useRef<number | null>(null);
9595
const aiSummary = datasetDocument?.[".datainfo"]?.AISummary ?? "";
96+
const readme = datasetDocument?.["README"] ?? "";
9697
const handleSelectRevision = (newRev?: string | null) => {
9798
setSearchParams((prev) => {
9899
const p = new URLSearchParams(prev); // copy of the query url
@@ -808,7 +809,7 @@ const UpdatedDatasetDetailPage: React.FC = () => {
808809
)}
809810

810811
{/* ai summary */}
811-
{aiSummary && (
812+
{aiSummary ? (
812813
<>
813814
<Box
814815
sx={{
@@ -866,6 +867,29 @@ const UpdatedDatasetDetailPage: React.FC = () => {
866867

867868
<ReadMoreText text={aiSummary} />
868869
</>
870+
) : readme ? (
871+
<>
872+
<Box
873+
sx={{
874+
display: "flex",
875+
alignItems: "center",
876+
mb: 0.5,
877+
mt: 1,
878+
gap: 0.5,
879+
}}
880+
>
881+
<Typography
882+
color={Colors.purple}
883+
sx={{ fontWeight: "bold", mb: 0.5, mt: 1 }}
884+
>
885+
Summary
886+
</Typography>
887+
</Box>
888+
889+
<ReadMoreText text={readme} />
890+
</>
891+
) : (
892+
""
869893
)}
870894

871895
<Box

0 commit comments

Comments
 (0)