Skip to content

Commit

Permalink
connections defaults to either references to comments based on knowle…
Browse files Browse the repository at this point in the history
…dge type
  • Loading branch information
shawnmclean committed Dec 19, 2024
1 parent 448f258 commit b2a0901
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"use client";

import type { SelectKnowledgeSchema } from "@sovoli/db/schema";
import { useState } from "react";
import { Chip } from "@sovoli/ui/components/ui/chip";
// import { Button } from "../ui/button";
import { Tab, Tabs } from "@sovoli/ui/components/ui/tabs";
Expand All @@ -13,12 +14,19 @@ export interface ConnectionsProps {
knowledge: SelectKnowledgeSchema;
}
export function Connections({ knowledge }: ConnectionsProps) {
const [selectedKey, setSelectedKey] = useState<string>(
knowledge.type === "shelf" || knowledge.type === "collection"
? "references"
: "replies",
);
return (
<Tabs
aria-label="Comment Options"
color="primary"
variant="bordered"
fullWidth
selectedKey={selectedKey}
onSelectionChange={(key) => setSelectedKey(key as string)}
>
<Tab
key="replies"
Expand Down

0 comments on commit b2a0901

Please sign in to comment.