This commit is contained in:
@@ -63,6 +63,8 @@ export const DrivePreview: React.FC<DrivePreviewProps> = ({ items }) => {
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
if (items.length < 2)
|
||||
return () => {};
|
||||
addShortcut({ shortcut: 'Right', handler: handleSwitchRight });
|
||||
addShortcut({ shortcut: 'Left', handler: handleSwitchLeft });
|
||||
|
||||
@@ -146,6 +148,8 @@ export const DrivePreview: React.FC<DrivePreviewProps> = ({ items }) => {
|
||||
</div>
|
||||
<div className="whitespace-nowrap flex items-center">
|
||||
<Controls type={type} />
|
||||
{items.length > 1 &&
|
||||
<>
|
||||
<Button
|
||||
iconSize="lg"
|
||||
className="ml-4 !rounded-full"
|
||||
@@ -162,6 +166,8 @@ export const DrivePreview: React.FC<DrivePreviewProps> = ({ items }) => {
|
||||
icon={ArrowRightIcon}
|
||||
onClick={ handleSwitchRight }
|
||||
/>
|
||||
</>
|
||||
}
|
||||
<Button
|
||||
iconSize="lg"
|
||||
className="ml-4 !rounded-full"
|
||||
|
||||
Reference in New Issue
Block a user