refactor(packages): clean up UI component types and data flow (#479)

This commit is contained in:
rahim
2026-02-09 20:15:26 +11:00
committed by GitHub
parent fef26c8421
commit 5f5ffb9f0a
32 changed files with 681 additions and 732 deletions
@@ -1,6 +1,6 @@
'use client';
import { MuteButtonCore, MuteButtonDataAttributes } from '@videojs/core';
import { MuteButtonCore, MuteButtonDataAttrs } from '@videojs/core';
import { logMissingFeature, selectVolume } from '@videojs/core/dom';
import type { ForwardedRef } from 'react';
import { forwardRef, useState } from 'react';
@@ -33,18 +33,20 @@ export const MuteButton = forwardRef(function MuteButton(
});
if (!volume) {
logMissingFeature('MuteButton', 'volume');
if (__DEV__) logMissingFeature('MuteButton', 'volume');
return null;
}
const state = core.getState(volume);
return renderElement(
'button',
{ render, className, style },
{
state: core.getState(volume),
state,
stateAttrMap: MuteButtonDataAttrs,
ref: [forwardedRef, buttonRef],
props: [core.getAttrs(volume), elementProps, getButtonProps()],
stateAttrMap: MuteButtonDataAttributes,
props: [core.getAttrs(state), elementProps, getButtonProps()],
}
);
});