Fix props

This commit is contained in:
2024-06-11 15:00:41 +02:00
parent ac51df26a5
commit 742d97797f
4 changed files with 14 additions and 11 deletions

View File

@@ -42,7 +42,7 @@ export function TopicList({
const scrollToTopic = () => {
const topicDiv = document.getElementById(
`accordion-button-topic-${activeTopic?.id}`,
`accordion-button-topic-${activeTopic?.id}`
);
setTimeout(() => {
@@ -63,7 +63,7 @@ export function TopicList({
const toggleScroll = (element) => {
const bottom =
Math.abs(
element.scrollHeight - element.clientHeight - element.scrollTop,
element.scrollHeight - element.clientHeight - element.scrollTop
) < 2 || element.scrollHeight == element.clientHeight;
if (!bottom && autoscrollEnabled) {
setAutoscrollEnabled(false);
@@ -97,7 +97,7 @@ export function TopicList({
if (!participants.response) return;
return (
participants.response.find(
(participant) => participant.speaker == speakerNumber,
(participant) => participant.speaker == speakerNumber
)?.name || `Speaker ${speakerNumber}`
);
};
@@ -134,6 +134,8 @@ export function TopicList({
overflowY={"auto"}
h={"100%"}
onScroll={handleScroll}
width="full"
padding={2}
>
{topics.length > 0 && (
<Accordion
@@ -146,17 +148,16 @@ export function TopicList({
key={index}
background={{
base: "light",
_hover: "gray.100",
_focus: "gray.100",
hover: "gray.100",
focus: "gray.100",
}}
padding={2}
id={`topic-${topic.id}`}
>
<Flex dir="row" letterSpacing={".2"}>
<AccordionButton
onClick={() => {
setActiveTopic(
activeTopic?.id == topic.id ? null : topic,
activeTopic?.id == topic.id ? null : topic
);
}}
>
@@ -199,7 +200,7 @@ export function TopicList({
fontSize={"sm"}
color={generateHighContrastColor(
`Speaker ${segment.speaker}`,
[96, 165, 250],
[96, 165, 250]
)}
>
{" "}