openreplay/frontend/app/components/Highlights/HighlightsListHeader.tsx
Delirium 2cd96b0df0
Highlight UI (#2951)
* ui: start highlight ui

* ui: tag items

* ui: connecting highlights to notes api...

* Highlight feature refinements (#2948)

* ui: move clips player to foss, connect notes api to hl

* ui: tune note/hl editing, prevent zoom slider body from jumping around

* ui: safe check for tag

* ui: fix thumbnail gen

* ui: fix thumbnail gen

* ui: make player modal wider, add shadow

* ui: custom warn barge for clips

* ui: swap icon for note event wrapper

* ui: rm other, fix cancel

* ui: moving around creation modal

* ui: bg tint

* ui: rm disabled for text btn

* ui: fix ownership sorting

* ui: close player on bg click

* ui: fix query, fix min distance for default range

* ui: move hl list header out of list comp

* ui: spot list header segmented size

* Various improvements in highlights (#2955)

* ui: update hl in hlPanel comp

* ui: rm debug

* ui: fix icons file

---------

Co-authored-by: Sudheer Salavadi <connect.uxmaster@gmail.com>
2025-01-24 09:59:54 +01:00

96 lines
No EOL
2.4 KiB
TypeScript

import React from 'react'
import { iTag, TAGS } from "App/services/NotesService";
import { SortDropdown } from "Components/shared/SessionsTabOverview/components/SessionSort/SessionSort";
import { Input, Segmented } from "antd";
function HighlightsListHeader({
activeTags,
ownOnly,
toggleShared,
toggleTag,
query,
onSearch,
handleInputChange
}: {
activeTags: iTag[];
ownOnly: boolean;
toggleShared: (value: boolean) => void;
toggleTag: (value?: iTag) => void;
query: string;
onSearch: (value: string) => void;
handleInputChange: (e: React.ChangeEvent<HTMLInputElement>) => void;
}) {
return (
<div className={'flex p-2 px-4 w-full border-b gap-4 items-center'}>
<h1 className={'text-2xl capitalize mr-2'}>Highlights</h1>
<Segmented
size="small"
options={[
{
value: 'ALL',
label: (
<div
className={
activeTags.includes('ALL') || activeTags.length === 0
? 'text-main'
: ''
}
>
All
</div>
),
},
...TAGS.map((tag: iTag) => ({
value: tag,
label: (
<div
className={
activeTags.includes(tag)
? 'text-main capitalize'
: 'capitalize'
}
>
{tag.toLowerCase()}
</div>
),
})),
]}
onChange={(value: iTag) =>
toggleTag(value === 'ALL' ? undefined : value)
}
/>
<div className={'ml-auto'}>
<SortDropdown
sortOptions={[
{
key: 'own',
label: 'Personal',
},
{
key: 'team',
label: 'Team',
},
]}
onSort={({ key }) => {
toggleShared(key === 'own');
}}
current={ownOnly ? 'Personal' : 'Team'}
/>
</div>
<div className="w-56">
<Input.Search
value={query}
allowClear
name="spot-search"
placeholder="Filter by title"
onChange={handleInputChange}
onSearch={onSearch}
className="rounded-lg"
size="small"
/>
</div>
</div>
)
}
export default HighlightsListHeader