Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 27 additions & 2 deletions src/components/CurationSection.tsx
Original file line number Diff line number Diff line change
@@ -1,16 +1,41 @@
import { getFileIdentities } from "@/serverFns/latex.server";
import { Group, Loader, SimpleGrid, Stack, Text, Title } from "@mantine/core";
import {
Group,
Loader,
Select,
SimpleGrid,
Stack,
Text,
Title,
} from "@mantine/core";
import { useQuery } from "@tanstack/react-query";
import { StexCuration } from "./StexCuration";

export function CurationSection() {
type Props = {
curationLevel: string | null;
setCurationLevel: (value: string | null) => void;
};

export function CurationSection({ curationLevel, setCurationLevel }: Props) {
const { data: fileGroups = [], isLoading } = useQuery({
queryKey: ["fileIdentities"],
queryFn: getFileIdentities,
});

return (
<Stack w="100%" maw={1200} gap="lg">
<Select
label="Curation Level"
value={curationLevel}
onChange={setCurationLevel}
data={[
{ value: "EXTRACTED", label: "EXTRACTED" },
{ value: "SNIFIED", label: "sn-ified" },
{ value: "FINALIZED", label: "finalized in file" },
{ value: "SUBMITTED", label: "submitted to mathhub" },
]}
w={250}
/>
<Group justify="space-between" align="center">
<Stack gap={4}>
<Title order={3}>FTML Definitions by File</Title>
Expand Down
10 changes: 8 additions & 2 deletions src/components/ExtractedTextList.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import { FolderSymlink } from "lucide-react";
import { FtmlPreview } from "./FtmlPreview";

interface ExtractedTextPanelProps {
isLocked?: boolean;
extracts: ExtractedItem[];
editingId: string | null;
selectedId: string | null;
Expand All @@ -21,13 +22,14 @@ interface ExtractedTextPanelProps {
id: string,
statement: ExtractedItem["statement"],
) => Promise<void>;
onDownload?: (item: ExtractedItem) => void;
onDelete: (id: string) => void;
onSelection: (extractId: string) => void;
onOpenSemanticPanel: (definitionId: string) => void;
showPageNumber?: boolean;
showDefinitionMeta?: boolean;
onEditDefinitionMeta?: (item: ExtractedItem) => void;
showDefinitionMetaIconOnly?: boolean;
onEditDefinitionMeta?: (item: ExtractedItem) => void;
showDefinitionMetaIconOnly?: boolean;
}

export function ExtractedTextPanel({
Expand All @@ -43,6 +45,7 @@ export function ExtractedTextPanel({
showDefinitionMeta = true,
showDefinitionMetaIconOnly = false,
onEditDefinitionMeta,
isLocked = false,
}: ExtractedTextPanelProps) {
return (
<Paper withBorder p="md" h="100%" radius="md" bg="blue.0">
Expand Down Expand Up @@ -84,6 +87,7 @@ export function ExtractedTextPanel({
<ActionIcon
size="sm"
color="red"
disabled={isLocked}
onClick={() => onDelete(item.id)}
>
<IconTrash size={14} />
Expand All @@ -92,6 +96,7 @@ export function ExtractedTextPanel({
<ActionIcon
size="sm"
variant="subtle"
disabled={isLocked}
onClick={() => onToggleEdit(item.id)}
>
<IconPencil size={16} />
Expand All @@ -100,6 +105,7 @@ export function ExtractedTextPanel({
<ActionIcon
size="sm"
variant="subtle"
disabled={isLocked}
onClick={() => onOpenSemanticPanel(item.id)}
>
<IconSettings size={16} />
Expand Down
Loading