mirror of
https://github.com/zoriya/v10.git
synced 2026-08-16 02:45:09 +00:00
Co-authored-by: Rahim <rahim.alwer@gmail.com> Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
34 lines
1.0 KiB
TypeScript
34 lines
1.0 KiB
TypeScript
'use client';
|
|
|
|
import { getSeekIndicatorDisplayValue, type SeekIndicatorCore } from '@videojs/core';
|
|
import type { ForwardedRef } from 'react';
|
|
import { forwardRef } from 'react';
|
|
|
|
import type { UIComponentProps } from '../../utils/types';
|
|
import { renderElement } from '../../utils/use-render';
|
|
import { useSeekIndicatorContext } from './context';
|
|
|
|
export interface SeekIndicatorValueProps extends UIComponentProps<'div', SeekIndicatorCore.State> {}
|
|
|
|
export const SeekIndicatorValue = forwardRef(function SeekIndicatorValue(
|
|
componentProps: SeekIndicatorValueProps,
|
|
forwardedRef: ForwardedRef<HTMLDivElement>
|
|
) {
|
|
const { render, className, style, ...elementProps } = componentProps;
|
|
const { state } = useSeekIndicatorContext();
|
|
|
|
return renderElement(
|
|
'div',
|
|
{ render, className, style },
|
|
{
|
|
state,
|
|
ref: forwardedRef,
|
|
props: [{ children: getSeekIndicatorDisplayValue(state) }, elementProps],
|
|
}
|
|
);
|
|
});
|
|
|
|
export namespace SeekIndicatorValue {
|
|
export type Props = SeekIndicatorValueProps;
|
|
}
|