import {MixedImage} from '../ui/images/mixed-image';
import clsx from 'clsx';
import React, {JSXElementConstructor} from 'react';
import {
DatabaseNotification,
DatabaseNotificationLine,
} from './database-notification';
import {FormattedRelativeTime} from '@common/i18n/formatted-relative-time';
interface LineProps {
notification: DatabaseNotification;
line: DatabaseNotificationLine;
index: number;
iconRenderer?: JSXElementConstructor<{icon: string}>;
}
export function Line({notification, line, index, iconRenderer}: LineProps) {
const isPrimary = line.type === 'primary' || index === 0;
const Icon = iconRenderer || DefaultIconRenderer;
const Element = line.action ? 'a' : 'div';
return (
<>
{line.icon && }
{index === 0 && (
)}
>
);
}
interface DefaultIconRendererProps {
icon: string;
}
function DefaultIconRenderer({icon}: DefaultIconRendererProps) {
return ;
}