mediacms/frontend/src/static/js/components/MediaListHeader.tsx
2024-10-04 13:17:40 +03:00

29 lines
794 B
TypeScript
Executable File

import React from 'react';
import { translateString } from '../utils/helpers/';
interface MediaListHeaderProps {
title?: string;
viewAllLink?: string;
viewAllText?: string;
className?: string;
style?: { [key: string]: any };
}
export const MediaListHeader: React.FC<MediaListHeaderProps> = (props) => {
const viewAllText = props.viewAllText || translateString('VIEW ALL');
return (
<div className={(props.className ? props.className + ' ' : '') + 'media-list-header'} style={props.style}>
<h2>{props.title}</h2>
{props.viewAllLink ? (
<h3>
{' '}
<a href={props.viewAllLink} title={viewAllText}>
{' '}
{viewAllText || props.viewAllLink}{' '}
</a>{' '}
</h3>
) : null}
</div>
);
};