62 lines
1.9 KiB
TypeScript
62 lines
1.9 KiB
TypeScript
import React from 'react';
|
|
import { useTranslation } from 'react-i18next';
|
|
import { PlayreelJob } from '../../utils/playreelApi';
|
|
|
|
interface PlayreelResultContentProps {
|
|
job: PlayreelJob;
|
|
/** 새 롱컷으로 처음부터 */
|
|
onNew: () => void;
|
|
}
|
|
|
|
/**
|
|
* 롱컷 완성 화면.
|
|
*
|
|
* 완성 영상은 blob 에 내려받기 헤더가 붙어 있어, 주소를 그대로 열면 파일로 저장된다.
|
|
* `<a download>` 는 다른 출처에 듣지 않으므로 이 속성에 기대지 않는다.
|
|
*/
|
|
const PlayreelResultContent: React.FC<PlayreelResultContentProps> = ({ job, onNew }) => {
|
|
const { t } = useTranslation();
|
|
|
|
const video = job.artifacts.video ?? '';
|
|
|
|
return (
|
|
<div className="p2v-scope p2v-result">
|
|
<h2 className="p2v-result__title">{t('playreel.result.title')}</h2>
|
|
|
|
<div className="p2v-result__grid">
|
|
<div className="p2v-panel p2v-result__player">
|
|
{video ? (
|
|
<video src={video} controls playsInline />
|
|
) : (
|
|
<p className="p2v-note">{t('playreel.result.videoMissing')}</p>
|
|
)}
|
|
</div>
|
|
|
|
<div className="p2v-result__side">
|
|
<p className="p2v-label">{t('playreel.result.fileName')}</p>
|
|
<p className="p2v-result__filename">{job.source.slug}_30_v{job.version}.mp4</p>
|
|
|
|
<p className="p2v-note">
|
|
{t('playreel.result.source')}{' '}
|
|
<a href={job.source.url} target="_blank" rel="noreferrer">{t('playreel.result.sourceLink')}</a>
|
|
</p>
|
|
|
|
<div className="p2v-result__actions">
|
|
{video && (
|
|
<a href={video} className="p2v-btn-cta p2v-btn-cta--compact">
|
|
{t('playreel.result.download')}
|
|
</a>
|
|
)}
|
|
</div>
|
|
</div>
|
|
</div>
|
|
|
|
<button type="button" className="p2v-btn-outline p2v-result__new" onClick={onNew}>
|
|
{t('playreel.result.new')}
|
|
</button>
|
|
</div>
|
|
);
|
|
};
|
|
|
|
export default PlayreelResultContent;
|