mirror of
https://github.com/cpvalente/ontime.git
synced 2026-09-13 10:09:35 +00:00
feat: project info view
This commit is contained in:
committed by
Carlos Valente
parent
312b294a61
commit
7aec3e0d73
@@ -0,0 +1,38 @@
|
||||
import { useSearchParams } from 'react-router-dom';
|
||||
import { ProjectData } from 'ontime-types';
|
||||
|
||||
import { isStringBoolean } from '../../../features/viewers/common/viewUtils';
|
||||
|
||||
interface PublicInfoProps {
|
||||
general: ProjectData;
|
||||
}
|
||||
|
||||
export default function PublicInfo(props: PublicInfoProps) {
|
||||
const { general } = props;
|
||||
const [searchParams] = useSearchParams();
|
||||
|
||||
const showPublic = isStringBoolean(searchParams.get('showPublic'));
|
||||
|
||||
if (!showPublic) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return (
|
||||
<>
|
||||
{general.publicInfo && (
|
||||
<>
|
||||
<div className='info__label'>Public info</div>
|
||||
<div className='info__value'>{general.publicInfo}</div>
|
||||
</>
|
||||
)}
|
||||
{general.publicUrl && (
|
||||
<>
|
||||
<div className='info__label'>Public URL</div>
|
||||
<a href={general.publicUrl} target='_blank' rel='noreferrer' className='info__value'>
|
||||
{general.publicUrl}
|
||||
</a>
|
||||
</>
|
||||
)}
|
||||
</>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user