import { SetStateAction } from 'react';

import updateClip from './updateClip';

export default function updateClipName(
  studioClipId: string,
  newName: SetStateAction<string>
) {
  return updateClip(studioClipId, (clip) => ({
    ...clip,
    name: newName instanceof Function ? newName(clip.name) : newName,
  }));
}
