mirror of
https://github.com/simstudioai/sim.git
synced 2026-01-08 22:48:14 -05:00
Fixed history id error
This commit is contained in:
@@ -8,6 +8,7 @@ interface HistoryDropdownItemProps {
|
||||
timestamp: number
|
||||
onClick?: () => void
|
||||
isCurrent?: boolean
|
||||
id?: string
|
||||
}
|
||||
|
||||
export function HistoryDropdownItem({
|
||||
@@ -15,6 +16,7 @@ export function HistoryDropdownItem({
|
||||
timestamp,
|
||||
onClick,
|
||||
isCurrent = false,
|
||||
id,
|
||||
}: HistoryDropdownItemProps) {
|
||||
const timeAgo = formatDistanceToNow(timestamp, { addSuffix: true })
|
||||
|
||||
|
||||
@@ -62,15 +62,15 @@ export function ControlBar() {
|
||||
<DropdownMenuContent align="end" className="w-60">
|
||||
<>
|
||||
<HistoryDropdownItem
|
||||
key={history.present.timestamp}
|
||||
key={`current-${history.present.timestamp}`}
|
||||
action={history.present.action}
|
||||
timestamp={history.present.timestamp}
|
||||
isCurrent={true}
|
||||
onClick={() => {}}
|
||||
/>
|
||||
{[...history.past].reverse().map((entry) => (
|
||||
{[...history.past].reverse().map((entry, index) => (
|
||||
<HistoryDropdownItem
|
||||
key={entry.timestamp}
|
||||
key={`past-${entry.timestamp}-${index}`}
|
||||
action={entry.action}
|
||||
timestamp={entry.timestamp}
|
||||
onClick={undo}
|
||||
|
||||
Reference in New Issue
Block a user