* 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>
57 lines
1.8 KiB
TypeScript
57 lines
1.8 KiB
TypeScript
import React from 'react';
|
|
import { Button, Tooltip } from '.store/antd-virtual-7db13b4af6/package';
|
|
import Session from 'Types/session';
|
|
import UserCard from 'Components/Session/Player/ClipPlayer/UserCard';
|
|
import QueueControls from 'Components/Session/Player/ClipPlayer/QueueControls';
|
|
import { App, Space } from 'antd';
|
|
import copy from 'copy-to-clipboard';
|
|
import { withSiteId } from '@/routes';
|
|
import * as routes from '@/routes';
|
|
import { useStore } from '@/mstore';
|
|
import { LinkIcon, X } from 'lucide-react';
|
|
import { PartialSessionBadge } from "Components/Session_/WarnBadge";
|
|
|
|
interface Props {
|
|
session: Session;
|
|
range: [number, number];
|
|
onClose?: () => void;
|
|
isHighlight?: boolean;
|
|
}
|
|
|
|
function ClipPlayerHeader(props: Props) {
|
|
const { projectsStore } = useStore();
|
|
const { session, range, onClose, isHighlight } = props;
|
|
const siteId = projectsStore.siteId;
|
|
const { message } = App.useApp();
|
|
|
|
const copyHandler = () => {
|
|
const path = withSiteId(routes.session(session.sessionId), siteId + '');
|
|
copy(window.location.origin + path + '?jumpto=' + Math.round(range[0]));
|
|
|
|
void message.success('Session link copied to clipboard');
|
|
};
|
|
return (
|
|
<div className="bg-white p-3 flex justify-between items-center border-b relative">
|
|
{isHighlight ? <PartialSessionBadge /> : null}
|
|
<UserCard session={props.session} />
|
|
|
|
<Space>
|
|
<Tooltip title="Copy link to clipboard" placement="bottom">
|
|
<Button
|
|
onClick={copyHandler}
|
|
size={'small'}
|
|
className="flex items-center justify-center"
|
|
>
|
|
<LinkIcon size={14} />
|
|
</Button>
|
|
</Tooltip>
|
|
|
|
{isHighlight ? (
|
|
<Button icon={<X size={14} strokeWidth={1} />} size={'small'} onClick={onClose} />
|
|
) : <QueueControls />}
|
|
</Space>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default ClipPlayerHeader;
|