zammad/app/frontend/apps/desktop/components/CommonTable/composables/useCellContent.ts
2026-01-02 15:41:09 +02:00

27 lines
721 B
TypeScript

// Copyright (C) 2012-2026 Zammad Foundation, https://zammad-foundation.org/
import Default from '../CellContent/Default.vue'
import Timestamp from '../CellContent/Timestamp.vue'
import TimestampAbsolute from '../CellContent/TimestampAbsolute.vue'
import type { Component } from 'vue'
export const useCellContent = () => {
const typeComponents: Record<string, Component> = {
default: Default,
timestamp: Timestamp,
timestamp_absolute: TimestampAbsolute,
}
const getCellContentComponent = (headerType?: string) => {
if (headerType && typeComponents[headerType]) {
return typeComponents[headerType]
}
return typeComponents.default
}
return {
getCellContentComponent,
}
}