import { Check, Copy, GitFork } from 'lucide-react' import { useTranslation } from '../../i18n' import { useSettingsStore } from '../../stores/settingsStore' import { formatExactMessageTimestamp, formatMessageTimestamp } from '../../lib/formatMessageTimestamp' import { CopyButton } from '../shared/CopyButton' export type MessageBranchAction = { label: string loading?: boolean onBranch: () => void } type Props = { copyText?: string copyLabel: string branchAction?: MessageBranchAction align?: 'start' | 'end' timestamp?: number } export function MessageActionBar({ copyText, copyLabel, branchAction, align = 'start', timestamp, }: Props) { const t = useTranslation() const locale = useSettingsStore((state) => state.locale) const hasCopy = Boolean(copyText?.trim()) const timeLabel = typeof timestamp === 'number' ? formatMessageTimestamp(timestamp, t, locale) : '' const exactTimeLabel = typeof timestamp === 'number' ? formatExactMessageTimestamp(timestamp, locale) : '' if (!hasCopy && !branchAction) return null return (